Hi,
I have developed small AJAX application, that gets the data from server and prints in the div element.. the AJAX request takes some time.. till the response returns I want to display the text ""Content is Loading, please wait...." in the <div> element...
The code is shown below.. This works perfectly fine with FireFox but in IE(6 and 7) I won;t get the "Content is Loading, please wait...." text I get the Ajax response from the server.
I tried having different <div> element but no help... :(
Any help will be greatly appreciated..
<script type="text/javascript">
var xmlhttp;
function loadXMLDoc(thisform){
document.getElementById('out').innerHTML="";
document.getElementById('out').innerHTML="Content is Loading, please wait....";
url = "someurl";
xmlhttp=null;
if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
if (window.XMLHttpRequest)
{// code for , Firefox, Opera, etc.
xmlhttp=new XMLHttpRequest();
}
}
if (xmlhttp!=null)
{
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
// Replacing the <div> value with Ajax output.
document.getElementById('out').innerHTML=xmlhttp.responseText;
}
}
else
{
alert("Your browser does not support Ajax.");
}
}
</script>
</head>
<body>
<form name=one>
Click</font><input type="text" width="100" size=50 name=path>
<input type=button value=SUBMIT onClick="loadXMLDoc(document.one)" >
</form>
<div name=out id=out></div>
</body>
</html>