[jQuery] BUG: $(document).ready never executes if window.onload is set in Firefox
function myOnload()
{
testFunction('JS: Test 1 Worked!');
}
function testFunction(str){
alert(str);
}
window.onload = myOnload;
$(document).ready(function(){
alert('jQuery TEST WORKED!');
});
IE 6.0.2xx... will execute both of the alerts
FF <a href="http://1.5.0.6">1.5.0.6</a> only alerts: 'JS: Test 1 Worked!'
after attempting to debug the issue, it looks a piece of code in jQuery never executes:
line:
987
code:
// If Mozilla is used
if ( jQuery.browser == "mozilla" || jQuery.browser == "opera" ) {
// Use the handy event callback
jQuery.event.add
( document, "DOMContentLoaded", jQuery.ready );
on that same note, the fallback isn't executed either:
line:
1027
code:
// A fallback to window.onload, that will always work
jQuery.event.add
( window, "load", jQuery.ready );
Any ideas?
Thanks,
Ilya Shindyapin
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/