如何知道DOM的第一个准备状态 [英] how to know the first ready state of DOM

查看:81
本文介绍了如何知道DOM的第一个准备状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取DOM的第一个准备状态。第二,第三等不是我的兴趣,而是第一个。有没有办法获得DOM的第一个准备状态?

i am trying to get the first ready state of the DOM. the second, third, etc is not interesting me, but the first one. is there any trick to get the first ready state of DOM?

$(document).ready(function() {
  // is it the first ready state?
});


推荐答案

啊,你使用的是jQuery。看看文档:只有一个准备就绪事件!我永远不会多次发火。 内部,甚至可以使用 Promise ,所以它不能多次点火。

Ah, you're using jQuery. Have a look at the docs: There is only one ready event! I will never fire multiple times. Internally, this is even handled with a Promise, so it cannot fire multiple times.

这篇关于如何知道DOM的第一个准备状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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