Jump to content

Change not saving in XML file


Bruce432213
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...