views:

43

answers:

1

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 seems 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);
+1  A: 

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">
Garis Suero
using both at the same time does the trick :)
Thqr