Debt Consolidation - Debt Consolidation - Creative Electronics - Debt Consolidation - Debt Consolidation

PDA

View Full Version : .innerHTML Internet Explorer won't display html


jestep
Apr 25th 2006, 3:58 pm
Here's the problem.

I have a simple Ajax script and I need to get the script to display any returned data (html data) as html. Firefox has no problem with it, but IE only display's text.

Here's what the script returns:

function handleHttpResponse() {

if (http.readyState == 4) {

results = http.responseText;

if (document.getElementById){
document.getElementById('text').innerHTML = results;
} else if (document.all) {
document.all("text").innerHTML = results;
} else if (document.layers){
document.layers['text'].document.open();
document.layers['text'].document.write(results);
document.layers['text'].document.close();
document.layers['text'].visibility = 'show';
}
}
}

jestep
Apr 25th 2006, 4:12 pm
Ok, I got my Internet Explorer to work sort of. I had to completely close my current window to get it to work. Does internet explorer do javascript caching or something else that would keep the script showing the same content?

Is there a way to reset the whole process every time the script is processed?

exam
Apr 25th 2006, 5:00 pm
Make sure your backend script is sending no-cache headers. In Php you can add one or all of:

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");