jquery wait
-
Hi , I on button click I open a jquery modal with iframe which loads another aspx page. Now this other aspx page makes a call to webservice and then loads data. I have the service call on the page load of this page. So there a gap between the modal window opens and the data load in it. How can I implement a wait gif or just a text like say 'processing' till the data loads? Thanks My code is as below
<div id="mydiv" >
<iframe id ="popup" width ="100%" height="50%"></iframe>
</div>jquery/javascript
function openDialog() {
var url = "test.aspx?NAME=" + encodeURIComponent($("#<%=txtName.ClientID %>").val()); $("#popup").attr("src", url); $("#mydiv").dialog('open'); }
$(document).ready(function() {
$("#mydiv").dialog({ autoOpen: false, modal: true, width: 500, scroll: true }); });
-
Hi , I on button click I open a jquery modal with iframe which loads another aspx page. Now this other aspx page makes a call to webservice and then loads data. I have the service call on the page load of this page. So there a gap between the modal window opens and the data load in it. How can I implement a wait gif or just a text like say 'processing' till the data loads? Thanks My code is as below
<div id="mydiv" >
<iframe id ="popup" width ="100%" height="50%"></iframe>
</div>jquery/javascript
function openDialog() {
var url = "test.aspx?NAME=" + encodeURIComponent($("#<%=txtName.ClientID %>").val()); $("#popup").attr("src", url); $("#mydiv").dialog('open'); }
$(document).ready(function() {
$("#mydiv").dialog({ autoOpen: false, modal: true, width: 500, scroll: true }); });
You don't really need to use an iframe in this instance, at least that I can see. iframes are typically used to display content from a different source, like a different URL. You can simply replace the the HTML content of the div. That would give you more control over the process The general idea is
function openDialog()
{
$("#wait").show();$.ajax({
url: "test.aspx?NAME=" + encodeURIComponent($("#<%=txtName.ClientID %>").val());,
success: complete;
}
});
}function complete(result)
{
$("#wait").hide();$("#mydiv").html(result);
// show dialog
}
I know the language. I've read a book. - _Madmatt