|
Post by microfarad on Dec 11, 2010 7:29:26 GMT
The following script is almost what I want. Instead of writing yes or no, I would like it to change between two images. I would also like this to loop forever. The commented out code to make it loop does not work. I have done both of these things in the past, but for some reason I can't get it to work in this script. If you do not answer within 8 hours and 30 minutes of this post, don't bother, it will be too late.
<script type="text/javascript"> //Initialize MAIN();
function MAIN() { LVLA=LoadXML("TestingXML.xml"); LVLB=ChildNamed(LVLA,"ADocument"); LVLC=ChildNamed(LVLB,"AH"); LVLD=ChildNamed(LVLC,"BLAH").childNodes[0]; if (LVLD.nodeValue=="True") { document.write("Yes"); } else { document.write("No"); } LoopBack(); }
function LoadXML(location) { document.write("1"); if (window.XMLHttpRequest) { //IE7+ Firefox Chrome Opera Safari xmlhttp=new XMLHttpRequest(); } else { //IE6 IE5 'cause them weird xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET",location,false); xmlhttp.send(); document.write("2"); return xmlhttp.responseXML; }
function ChildNamed(XMLnode,name) { for (n=0;n<XMLnode.childNodes.length;n=n+1) { if (XMLnode.childNodes[n].nodeName==name) { return XMLnode.childNodes[n]; } } }
function LoopBack() { //var t=setTimeout("MAIN()",200); } </script>
|
|
|
Post by ~Memzak~ on Dec 11, 2010 16:28:29 GMT
I looked at it, and as I said on private chat.
I could try and help you, but most of the things I do I probably wouldn't know what's cracking. It's just better to wait for General Veers to see this thread. He is very good at Javascript.
(or you could wait for disabled)
Shouldn't this be in the newly created Technology sub-board?
|
|