xcandiottix Posted July 20, 2010 Share Posted July 20, 2010 I have a tough problem here. Currently, I have a page that runs a little ajax. It calls out to an XML file and returns a text string. I need to replace the test string with the location of a .php file. When the page loads, I need the .php file to be loaded in place of the text string. function selection(selected){ var y=xmlDoc.getElementsByTagName("Name"); for (j=0;j<y.length;j++){ if(selected == y[j].getAttribute("N")){ //sets titles title1=y[j].getElementsByTagName("Cell")[0].getElementsByTagName("title")[0].childNodes[0].nodeValue; document.getElementById("tit1").innerHTML=title1; title2=y[j].getElementsByTagName("Cell")[1].getElementsByTagName("title")[0].childNodes[0].nodeValue; document.getElementById("tit2").innerHTML=title2; title3=y[j].getElementsByTagName("Cell")[2].getElementsByTagName("title")[0].childNodes[0].nodeValue; document.getElementById("tit3").innerHTML=title3; //sets applications application1=y[j].getElementsByTagName("Cell")[0].getElementsByTagName("Application")[0].childNodes[0].nodeValue; document.getElementById("app1").innerHTML=application1; application2=y[j].getElementsByTagName("Cell")[1].getElementsByTagName("Application")[0].childNodes[0].nodeValue; document.getElementById("app2").innerHTML=application2; application3=y[j].getElementsByTagName("Cell")[2].getElementsByTagName("Application")[0].childNodes[0].nodeValue; document.getElementById("app3").innerHTML=application3; } } //end } Above, I am checking the XML page to get the title and application text strings. They are printed out on the screen like so: Title 1 Title 2 Title3 App 1 App 2 App 3 What I need to happen is: Title 1 Title 2 the actual app1.php file to be loaded here etc.. How can I do this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.