Jump to content

bbarrick

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by bbarrick

  1. Thanks, that makes sense.
  2. Oh, so the document object is tossed out the same way a variable is in JavaScript once it's done with it?
  3. http://www.w3schools.com/dom/tryit.asp?filename=try_dom_change_nodevalue I guess maybe there is something in the .js file that it references in the head that calls a PHP function on the server side? Sort of misleading I guess.
  4. That's what I've heard, but according to the tutorials on this forum you can update xml values with javascript. This isn't going to be an external site that I'm working on, so I don't want to go so far as to setting up a webserver and php. Basically I have a computer that is running a 24 hour display of information(right now it's powerpoint presentation). It's on the network, and I was hoping that I could create a series of automatically redirecting web pages to replaces the powerpoint presentation and an html form that would update an xml file and change what was being displayed on the information screen.
  5. Ok, thanks...I thought I had it in there. I commented out loadXMLDoc and added .value but it still didn't update the XML file.
  6. Could use a little help with this if you guys don't mind. This is just for testing purposes for a potential project. Trying to keep it simple at this point. I have an HTML file called projectform.html. Basic html input box with a button. I want to type a name into that box, click on the button and change the value of an XML file. projectform.html <html><head> <title>Information Screen Form</title> <script src="jquery-1.9.1.min.js"></script> <script src="project.js"></script> <script>if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();} else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","datatest.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML;</script> </head><body> <div id="main"> <input type="text" id="inputname"> <input type="button" onclick="savename()"; value="Submit"></div></body></html> project.jsfunction savename() { xmlDoc=loadXMLDoc("datatest.xml"); x=xmlDoc.getElementsByTagName("fname")[0].childNodes[0]; x.nodeValue=document.getElementById("inputname");} XML just has the tags at this point. <?xml version="1.0" encoding="UTF-8" ?> <nurse> <fname>Tonya</fname> </nurse>
×
×
  • Create New...