Jump to content

Change not saving in XML file

Recommended Posts

Hi, the html file is showing that it has changed the value in the XML file, but when I open the XML file nothing has changed.

    var status=xmlDoc.getElementsByTagName("Seats");
    alert(status[2].getElementsByTagName("Status")[0].childNodes[0].nodeValue); //Unbooked
    status[2].getElementsByTagName("Status")[0].childNodes[0].nodeValue = "Booked"; 
    alert(status[2].getElementsByTagName("Status")[0].childNodes[0].nodeValue); //Booked

So, it changes from "Unbooked" to "Booked" but it doesn't change in the XML file. What's going on?

Link to post
Share on other sites

Changing a data structure in Javascript does not change files on disk.  Javascript running in a browser does not have permission to write to any files on your computer, thankfully.  If you want to change files on the server you need to use a server-side language like PHP for that.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...