xcandiottix Posted June 26, 2010 Share Posted June 26, 2010 aptbboarder=xmlDoc.getElementsByTagName("Name")[0].getElementsByTagName("app_table")[0].getElementsByTagName("boarder")[0].childNodes[0].nodeValue; aptbbgimage=xmlDoc.getElementsByTagName("Name")[0].getElementsByTagName("app_table")[0].getElementsByTagName("bgimage")[0].childNodes[0].nodeValue; aptbbgcolor=xmlDoc.getElementsByTagName("Name")[0].getElementsByTagName("app_table")[0].getElementsByTagName("bgcolor")[0].childNodes[0].nodeValue; function selection(selected){ var y=xmlDoc.getElementsByTagName("Name"); for (j=0;j<y.length;j++){ if(selected == y[j].getAttribute("N")){ //sets options aptbboarder=y[j].getElementsByTagName("app_table")[0].getElementsByTagName("boarder")[0].childNodes[0].nodeValue; aptbbgimage=y[j].getElementsByTagName("app_table")[0].getElementsByTagName("bgimage")[0].childNodes[0].nodeValue; aptbbgcolor=y[j].getElementsByTagName("app_table")[0].getElementsByTagName("bgcolor")[0].childNodes[0].nodeValue; //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 } //write coloumns document.write('<table width="100%" border="'+aptbboarder+'" background="'+aptbbgimage+'" bgcolor="'+aptbbgcolor+'">'); //document.write('<table width="100%" border="1" background="none" bgcolor="#FFFFFF">'); document.write('<tr>'); document.write("<td align='center'><div id='app1'></div></td>"); document.write("<td align='center'><div id='app2'></div></td>"); document.write("<td align='center'><div id='app3'></div></td>"); document.write('</tr>'); document.write('</table>'); The first APT variables refer to the XML doc to get the tables defaults. function selection() is activated when a user presses a button, the table is refreshed with new information APT's with-in the function does not work. APP 1,2,3 do work fine, so the function is operating properly. The document write section correctly shows a table with the 3 app variables but will not change from the default APT's set at the beginning of the code. To me, this would work if I could make the APT's a <div> and nest them inside the table vars (for example boarder=<div id=aptboarder></div> but I don't think that's proper formatting. Any ideas? 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.