[xmljs-users] Load xml from local site
Brought to you by:
djoham,
witchhunter
From: P. <sys...@fa...> - 2004-09-01 12:50:04
|
Hello I've just started playing with xmljs and it seems great. However, I've got a problem. I would like to load a xml-file from a local site every x second. It works ok. However, if I change the xml-file the browser keeps getting the old file. It is as if the xml file is kept in a cache or something. The new file is not loadet until I open mywebpage in a new browser session. Is there a way to force the browser not to keep the xml file in cache? Heres my code: <script> <!-- setInterval("loadLocalXML()",3000) function loadLocalXML() { xmlIOLoadLocalData("xmlData.xml.html", "callbackFunction"); } function callbackFunction(strXML) { //instantiate a new XMLDoc object. Send any errors to the xmlError function var objDom = new XMLDoc(strXML, xmlError) //get the root node var objDomTree = objDom.docNode; //get all of the elements named "TAG1" var tag1Elements = objDomTree.getElements("msg"); //get the first "TAG1" element var element = tag1Elements[0]; //now get the text var text = element.getText(); MM_changeProp('chatmsgs','','innerHTML',text,'DIV'); } function xmlError(e) { alert(e); } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_changeProp(objName,x,theProp,theValue) { //v6.0 var obj = MM_findObj(objName); if (obj && (theProp.indexOf("style.")==-1 || obj.style)){ if (theValue == true || theValue == false) eval("obj."+theProp+"="+theValue); else eval("obj."+theProp+"='"+theValue+"'"); } } //--> </script> |