开发者

jquery iframe src loading delay

开发者 https://www.devze.com 2023-03-05 09:00 出处:网络
I have a jquery modal on my page[parent aspx]. The div which opens has an iframe in it. I set the source on modal open functionwhich is actually another aspx page with some values from my parent aspx.

I have a jquery modal on my page[parent aspx]. The div which opens has an iframe in it. I set the source on modal open function which is actually another aspx page with some values from my parent aspx.

Now other aspx page takes time to display formatted results back from an external datasource. Hence开发者_运维问答 the modal window opens and user has to wait before content is loaded.

Is it possible to display a label like wait or working or anyother gif till the aspx page returns values.

Edited to add:-

function openDialog() {                                                             var url = "result.aspx?NAME=" + encodeURIComponent($("#<%=txtcity.ClientID %>").val()) + "&Type= " + encodeURIComponent($("#<%=txtType.ClientID %>").val()) ;
            $("#popup").attr("src", url);
            $("#carModal").dialog('open');
        }
    }

My div is as below:

<div id="carModal" >        
    <iframe id ="popup"  width ="100%" height="100%"></iframe>
</div> 

In the onload of result.aspx I pass the two values to external service and map the result to GridView. This is what takes time to load. The jquery popup comes without any data loaded as the result.aspx on lad is still working. I also return the grid row values to parent page and populate controls


usually in your .ajax function you can make a hidden loading gif (display:none in css) to appear and make it hidden again the success callback function. It would be easier to assist you if you paste some of your jQuery code/aspx here.

Also refer to this post as well which can give you more information

0

精彩评论

暂无评论...
验证码 换一张
取 消