Does anyone know why jQuery document ready might not fire on a website? I put exactly this script in footer and it simply doesn't fire (jQuery 1.8 is included in head section):
<script type="text/javascript">
jQuery(document).ready(function() {
alert('test');
jQuery("#slideshow iframe").each(function(){
alert('test');
});
});
</script>
There are no Javascript errors, console is empty and when I run this in Firebug's console it works:
jQuery("#slideshow iframe").each(function(){
alert('test');
});
While that was not the case in this specific instance, one very annoying way in which this can happen is jQuery bug 10251: an error in a $(document).ready()
callback will prevent all callbacks registered after it from running. (In this case there will be a Javascript error, it might look completely unrelated, though.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With