【发布时间】:2013-03-22 01:27:01
【问题描述】:
我很好奇在使用 jQuery 和 jQuery Mobile 时哪个事件首先被触发。
奇怪的是,我得到的第一个控制台输出是pagebeforecreate,然后是document ready,然后是onload。
我想知道在这些事件之前是否有其他事件被触发。
$('html').bind('pagebeforecreate',function(event) {
console.log("pagebeforecreate");
});
$(document).ready(function() {
console.log("document ready");
});
window.onload = function(){
console.log("onload");
};
【问题讨论】:
-
我们可以知道为什么吗?
-
这是专门针对 jQuery Mobile 的吗?因为 pagebeforecreate 不是标准事件。
-
为什么不在不绑定事件的情况下立即做你的事情?
标签: javascript jquery html jquery-mobile