In left menu bar i am having two links about and messages while clicking on messages it is fetching user message page from server it is working properly.
I want to show some picture as loading symbol to user, where to put that code i didn’t get it.
I am using following ajax code to fetch message page from server
function getMessages(id)
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if (typeof xmlhttp == "undefined")
{
ContentDiv.innerHTML="<h1>XMLHttp cannot be created!</h1>";
}
else{
var query='message?id='+id;
xmlhttp.open("GET",query,true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("profile-detail").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send();
}
}
1 Assume you have in you page
2 Put this line just after
var xmlhttp;3 Put this line
after
I hope this will do the job