live()和ready()之间的jQuery区别? [英] jQuery difference between live() and ready()?

查看:120
本文介绍了live()和ready()之间的jQuery区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

live()ready()之间的确切区别是什么?

What is the exact difference between live() and ready()?

发现 die() live()

推荐答案

.ready() 允许您注册在DOM准备就绪时触发的回调-与使用window.onload相似,但触发更早(并且您可以注册多个回调).

.ready() lets you register a callback that fires when the DOM is ready - this is similar to using window.onload but fires earlier (and you can register more than one callback).

.live() 可让您基于选择器注册对一系列事件的回调,它将持续监视DOM,并将其自身注册到添加的新节点.

.live() lets you register a callback to a range of events based on a selector, which continually monitors the DOM and will register itself to new nodes that are added.

这篇关于live()和ready()之间的jQuery区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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