Thank you but i still don't quite understand fully. Ive read about the serializeToString(). After using that to get the xmldom object into a string how would i save it to the file. The documentation in that file is very mediocre and confusing.
Last edited by jblevins1991; 09-11-2012 at 10:16 PM.
To send data back to the server whether is plain text, xml or json encoded data, you should POST instead of GET.
xhr.open("POST", "url"); //url of your server-side script to receive the XML data
xhr.send(xmldoc); //xmldoc is your XML formatted document
The problem with this is that we don't have an instance to the xml document until the ready state is 4, after the send method is called. This would not do a thing. The send method is mainly used to send form data to the server then the server would respond with the result from a php, asp, or xml file. i would have to save the dom structure to the xml file after appendChild is called.
to save your xml in a file you need a tool which has feature to write data in files for example PHP. as PHP is simple easy and commonly used language. you can send your xml to a php script which will store it in a file. its as simple.
The file is already created seeing as it is not practical to create a new file everytime you need to write to it. I need to overwrite the old files contents with the dom structure that was modified. I need to use javscript not php.
what, do you think all us posters and google are conspiring to keep a file-saving routine secret? nothing works on all OSs; iOS doesn't event have a file system to save to! ajax was invented to load mail messages into a web client, FORMs have always been the #1 way of saving data, and forms send data to servers. would you really want any old site saving files onto your computer?
I had to think about it for a second lol. client sided+should not have access to server sided content=dum dum. I have figured out how to do this with php. I will link the threads where i posted the php code so others may see that when they look this thread up in the search. Thank you for all of the help. I appreciate it.