Jump to content

How to solve memory leak in IE


phpmady

Recommended Posts

Hi,

 

I couldnt refresh the content in the div id "content",  but it works in firefox and chrome

 

<html>
<body>
<script type="text/javascript">
function Ajax(){
var xmlHttp;
try{	
	xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
}
catch (e){
	try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
	}
	catch (e){
	    try{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e){
			alert("No AJAX!?");
			return false;
		}
	}
}

xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
	document.getElementById('content').innerHTML=xmlHttp.responseText;
	setTimeout('Ajax()',1000);
}
}
xmlHttp.open("GET","data.php",true);
xmlHttp.send(null);
}

window.onload=function(){
setTimeout('Ajax()',1000);
}
</script>
<div id="content">Default text</div>
</body>
</html>

 

this is the code am using

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/230791-how-to-solve-memory-leak-in-ie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.