经过一些研究,我创造了一种使其工作的方法。
这是我的测试,表明它可以正常工作:http :
//www.antiyes.com/test/test2.php
这是相关代码:
<script> // easy copy of an array Array.prototype.copy = function() { return [].concat(this); }; // this function is added to jQuery, it allows access to the readylist // it works for jQuery 1.3.2, it might break on future versions $.getReadyList = function() { if(this.readyList != null) this.myreadylist = this.readyList.copy(); return this.myreadylist; }; $(document).ready(function() { alert("blah"); });</script><script> // this should be added last so it gets all the ready event $(document).ready(function() { readylist = $.getReadyList(); });</script>然后在体内我有:
<input type="button" onclick="$(readylist).each(function(){this();});" value="trigger ready" />基本上,我所做的就是在jQuery中添加了一个函数,该函数在清除readyList之前将其复制出来,然后可供您使用。
看起来下面的代码不起作用:
function AjaxLoaded() { $(document).trigger('ready');}删除报价
document。



