Hi,
I am working on a task where I have used WebMethod using Json to insert and retrieve data from data base,
Now I want a gif image shows in a DIV whenever a WebMethod is called.
My js code is like this:
function getvalues(j, selectedTab) {
$("#DVloading").show();
$.ajax({
type: "POST",
url: "xxx.aspx/LoadData",
data: "{'id':'" + j + "','selectedTab':'" + selectedTab + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
if (msg.d.length > 0) {
var dv = document.getElementById("xxxDiv");
dv.innerHTML += msg.d;
}
},
async: false,
error: function(xhr, status, error) {
}
});
$("#").hide();
}
I have the page body like this:
<body>
<form id="form1" runat="server">
<div>
<div id="DVloading" style="display:none;">
<img src="../Images/circular.gif" width="20" height="23" />
</div>
<div id="xxxDiv">
</div>
</form>
</body></div>
But Here whenever the WebMethod is called the whole page is hanged for 10 second(the time to fetch data from DB) and nothing does. and when it loads all data then released the hanged. Image is not showing there.
Any help is greatly appreciated.
regards,
Tanweer,