Re: [xmljs-users] Load xml from local site
Brought to you by:
djoham,
witchhunter
From: P. <sys...@fa...> - 2004-09-01 16:39:53
|
Hi I solved the problem using Benno's suggestion of putting a random url-parameter on the xml-file loaded with xmlIOLoadLocalData. This is - of course - a much better than my own suggestion of modifying the core files. Now it's working fine. Thanks for the swift help, Soren Ps. Sorry for posting answers to private emails instead of mailinglist. Never really tried this before :-) On Wed, 01 Sep 2004 18:35:09 +0200, "S=F8ren Pedersen" <sys...@fa...> said: > Hi >=20 > I solved the problem using Benno's suggestion of putting a random > url-parameter on the xml-file loaded with xmlIOLoadLocalData. This is - > of course - a much better than my own suggestion of modifying the core > files. Now it's working fine. >=20 > Thanks for the swift help, >=20 > Soren >=20 >=20 >=20 > On Wed, 1 Sep 2004 08:46:05 -0700 (PDT), "David Joham" > <dj...@ya...> said: > >=20 > > Hmmm... Good question. Is this a problem you're seeing in development, = or > > somehow related to a > > production issue? > >=20 > > I just tried the following and it seemed to work in Konq and Mozilla. I > > added the following META > > tags to the top of the xml/html data file > >=20 > > <META HTTP-EQUIV=3D"Pragma" CONTENT=3D"no-cache"> > > <META HTTP-EQUIV=3D"Expires" CONTENT=3D"-1"> > >=20 > > It didn't seem to affect the data being returned to the IO function and > > it also seemed to allow > > the file to avoid being cached. > >=20 > > Please give that a shot and let me know if it works for you... > >=20 > >=20 > > Best regards, > >=20 > > David > >=20 > >=20 > > --- S\xF8ren Pedersen <sys...@fa...> wrote: > >=20 > > > Hello > > >=20 > > > 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 ever= y x > > > second. It works ok. However, if I change the xml-file the browser ke= eps > > > 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. > > >=20 > > > Is there a way to force the browser not to keep the xml file in cache? > > >=20 > > > Heres my code: > > >=20 > > > <script> > > > <!-- > > > setInterval("loadLocalXML()",3000)=20 > > >=20 > > > function loadLocalXML() { > > > xmlIOLoadLocalData("xmlData.xml.html", "callbackFunction"); > > > } > > >=20 > > > function callbackFunction(strXML) { > > > //instantiate a new XMLDoc object. Send any errors to the xmlError f= unction > > > var objDom =3D new XMLDoc(strXML, xmlError) > > > //get the root node > > > var objDomTree =3D objDom.docNode; > > > //get all of the elements named "TAG1" > > > var tag1Elements =3D objDomTree.getElements("msg"); > > > //get the first "TAG1" element > > > var element =3D tag1Elements[0]; > > > //now get the text > > > var text =3D element.getText(); > > > MM_changeProp('chatmsgs','','innerHTML',text,'DIV'); > > > } > > >=20 > > > function xmlError(e) { > > > alert(e); > > > } > > >=20 > > > function MM_findObj(n, d) { //v4.01 > > > var p,i,x; if(!d) d=3Ddocument; > > > if((p=3Dn.indexOf("?"))>0&&parent.frames.length) { > > > d=3Dparent.frames[n.substring(p+1)].document; n=3Dn.substring(0,p= );} > > > if(!(x=3Dd[n])&&d.all) x=3Dd.all[n]; for (i=3D0;!x&&i<d.forms.lengt= h;i++) > > > x=3Dd.forms[i][n]; > > > for(i=3D0;!x&&d.layers&&i<d.layers.length;i++) > > > x=3DMM_findObj(n,d.layers[i].document); > > > if(!x && d.getElementById) x=3Dd.getElementById(n); return x; > > > } > > >=20 > > > function MM_changeProp(objName,x,theProp,theValue) { //v6.0 > > > var obj =3D MM_findObj(objName); > > > if (obj && (theProp.indexOf("style.")=3D=3D-1 || obj.style)){ > > > if (theValue =3D=3D true || theValue =3D=3D false) > > > eval("obj."+theProp+"=3D"+theValue); > > > else eval("obj."+theProp+"=3D'"+theValue+"'"); > > > } > > > } > > > //--> > > > </script> > > >=20 > > >=20 > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by BEA Weblogic Workshop > > > FREE Java Enterprise J2EE developer tools! > > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > > http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick > > > _______________________________________________ > > > xmljs-users mailing list > > > xml...@li... > > > https://lists.sourceforge.net/lists/listinfo/xmljs-users > > >=20 > >=20 |