快速的......
如何在文档准备好的窗口加载中运行函数?
$(document).ready(function() {
//How do I run this, down from Load??
function thisFunction() {
alert("This function");
}
});
$(window).load(function() {
thisFunction();
});
答案 0 :(得分:1)
$(document).ready(function() {
//How do I run this, down from Load??
function thisFunction() {
alert("This function");
}
$(window).load(thisFunction);
});
答案 1 :(得分:1)
$(document).ready(function() {
//How do I run this, down from Load??
window.thisFunction = function() {
alert("This function");
}
});
$(window).load(function() {
thisFunction();
});
这样可行。