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');
});
You are currently getting this error on your page
The cause of this error is inside your
flow.anything-slider-1.0.jsat line11.The file is using
jQuery(document).ready(), so$is not defined.Changing line
11from using$tojQueryworks:The whole file uses jQuery instead of
$so the file should probably stick with the one way of using jQuery instead of mixing it up.Edit
I just double checked the .ready() documentation and the following paragraph was interesting as it seems to relate to the issue:
This would imply, that instead of fixing line
11you could also change your fist line tojQuery(document).ready(function($) {, passing the$as an argument. This might allow you then to use$throughout the file as well as jQuery.Anyway, not sure passing
$as an argument would work in your case, I just thought I mention it in case it does work.