473,403 Members | 2,293 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,403 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 1402
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?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.