spewn
Programmer
- May 7, 2001
- 1,034
here's my code:
this works great, it pulls the info from the file.
however, the info contained in the file changes, and when i run the script again, it still pulls the old info...even if i refresh the page.
i was reading up on this, and it seems that the HTTP call looks in the cache as to minimize the server calls(?).
so, any ideas to keep the content fresh, so that i pull from the file each and every time?
very new to ajax, so thanks in advance.
thanks!
- g
Code:
function createRequestObject() {
var ro;
browser = navigator.appName;
if(browser == "Microsoft Internet Explorer") {
ro = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
ro = new XMLHttpRequest();
}
return ro;
}
var http = createRequestObject();
function runvcodecheck() {
http.open('get', 'test-script.pl');
http.onreadystatechange = VCodeCheckResponse;
http.send(null);
}
function VCodeCheckResponse() {
if(http.readyState == 4){
response = http.responseText;
alert(response);
}
}
this works great, it pulls the info from the file.
however, the info contained in the file changes, and when i run the script again, it still pulls the old info...even if i refresh the page.
i was reading up on this, and it seems that the HTTP call looks in the cache as to minimize the server calls(?).
so, any ideas to keep the content fresh, so that i pull from the file each and every time?
very new to ajax, so thanks in advance.
thanks!
- g