[英]jQuery and ASP.NET: Execute site code after master page has finished initialization
[英]Execute code after page has finished loading javascript / jquery
因此,我正在加载一个URL,该URL需要花费相当长的时间才能加载,大约需要一分钟。 我想知道只有在页面完全完成加载后,我应该如何执行一些其他的javascript或jquery代码。
我正在尝试这个,但是没有用
$(document).ready(function()
{
$.ajaxSetup(
{
cache: false,
success: function() {
$('#div_loading').hide();
$('#div_done').show();
}
});
$.ajax("process.php?q=<?=$id?>&bitrate=<?=$bitrate?>");
});
您可以使用jQuery延迟对象,例如
$.ajax("process.php?q=<?=$id?>&bitrate=<?=$bitrate?>").then(function(data){
});
基本上,当$ .ajax调用返回时, then
函数将被执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.