PDA

View Full Version : how to disable browser cache for script objects


Tephra
10-18-2002, 11:57 AM
Hi All,

im new to this forum so please bear with me :)

im using the following:

function loadContent(file){
var scriptTag = document.getElementById('loadScript');
var head = document.getElementsByTagName('head').item(0)
if(scriptTag) head.removeChild(scriptTag);
script = document.createElement('script');
script.src = file;
script.type = 'text/javascript';
script.id = 'loadScript';
head.appendChild(script);
}

using loadContent('http://www/js.cgi') to load the "script"

however i want to do some dynamic content loading from a cgi script. this works fine when the browser is set to not cache anything.

using META tags doesn't work because it doesn't affect scripts loaded dynamically.

anyone know how to disable caching in the browser just for that session/page?

or a better way todo what i want.

Cheers
Dave