473,385 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

want to add a new node in xml file using javascript

I have an image on page and there are some points are placed and one text area is assigned to them.I want to give the name to that points in text area and want to save that in XML file.
and when we open the browser that name should should be there along with the point.

I have done it almost only I cannot save that names in xml...
May 22 '15 #1
6 1399
Dormilich
8,658 Expert Mod 8TB
I have done it almost
please show us that code.
May 22 '15 #2
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="loadxmldoc.js"> 
  5. </script>
  6. </head>
  7. <body>
  8.  
  9. <script>
  10. xmlDoc=loadXMLDoc("one.xml");
  11.  
  12. newNode=xmlDoc.createElement("book");
  13.  
  14. x=xmlDoc.documentElement;
  15. y=xmlDoc.getElementsByTagName("book");
  16.  
  17. document.write("Book elements before: " + y.length);
  18. document.write("<br>");
  19. x.insertBefore(newNode,y[3]);
  20.  
  21. y=xmlDoc.getElementsByTagName("book");
  22. document.write("Book elements after: " + y.length);
  23. </script></body></html>
May 22 '15 #3
Its code for adding node but the error occured in .js file
May 22 '15 #4
Dormilich
8,658 Expert Mod 8TB
what’s the error message?
May 22 '15 #5
undefined loadXMLDoc()
May 22 '15 #6
Dormilich
8,658 Expert Mod 8TB
then you should have a look into loadxmldoc.js how you load the file.
May 22 '15 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dhanasankar S via DotNetMonster.com | last post by:
Hai friends, Please give me an idea to read the content in the body part of a HTML file from another HTML file using Javascript. -- Message posted via http://www.dotnetmonster.com
1
by: rajarya | last post by:
Hi , I need to read a file(xml file) froma location in server by my client side HTML+Javascript code ,I did this using JSP,but now my requirement has been changed and I donot want any server side...
1
by: snitu | last post by:
hello i am new to using javascript. i have a problem in creating texonomy using xml file in javascript. my xml file is this ________________________________________ <?xml version="1.0"?>...
1
by: datttanand | last post by:
hello everybody, How to read a MS Word File using javascript? I want to read some data from existing file and wants to append it to my new word file, can anybody tell me how to do tjis with...
1
by: Nelson Joseph | last post by:
Hai all, I would like to create an XML file using JavaScript. Is it possible? Please tell me how can we create? Thanks in advance. - Nelson
2
by: subhash123 | last post by:
Hi All, Any one knows how to print pdf file using JavaScript. Please Suggest...
1
by: Kurri | last post by:
How to get the text from many CSS files and merge them into one file using javascript to avoid overhead at server side. Using C# or ASP.NET or Javascript or JQuery....
1
by: nNaveenpal | last post by:
how to validate input type file using javascript for file type and size?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.