开发者

Document.write being cached

开发者 https://www.devze.com 2023-01-08 03:05 出处:网络
I am using a script before page load to write some html into my page with doucment.write now this gets cached like crazy only a hard refresh se开发者_如何学Goems to update it.

I am using a script before page load to write some html into my page with doucment.write now this gets cached like crazy only a hard refresh se开发者_如何学Goems to update it.

Now before everyone goes "OMG DONT USE DOCUMNNT.WRIT" I will be getting rid of it but for the moment I need a quick fix.

So is there a way I can force this script to update everytime the page changes (note that it IS called everytime the page changes on multiple pages)

Code is generated on the fly but generally:

HTML:

<script type="text/javascript" src="NAV.js"></script>

Generated code:

d = new dTree('d');
d.add(4,0,'Maps');
d.add(5,4,'Web Map','WebMap.html');
document.write(d);


Try using a dummy parameter in your script tag... you can handle it from your server side language... and it will look something like this:

<script type="text/javascript" src="NAV.js?dummyParameter=546757657657"></script>

Also this code in your head tag will help you:

<META http-equiv="Pragma" content="no-cache">
0

精彩评论

暂无评论...
验证码 换一张
取 消