如果$(document).not-ready()?如何检查页面是否仍在使用Jquery加载? [英] if $(document).not-ready()? How can I check if the page is still loading with Jquery?

查看:104
本文介绍了如果$(document).not-ready()?如何检查页面是否仍在使用Jquery加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在文档仍在加载时调用一个函数.怎么办?

I want to call a function only if the document is still loading.. how can I?

推荐答案

您可以检查

You could check document.readyState or use a simple variable in the global scope:

var ready = false;
$(document).ready(function () {
    ready = true;
});

这篇关于如果$(document).not-ready()?如何检查页面是否仍在使用Jquery加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆