I have a page that uses the jquery function:
$(document).ready(function() {
and I have put an alert in there, and tried everything. It does
I had a similar problem and in my case, invoking an old jQuery Address .js file was the problem. For some reason, Edge, Chrome, and Opera were able to ignore maybe that old version of jQuery Address while keeping jQuery/JavaScript to work normally. But Mozilla Firefox did not behave in the same way, and jQuery/JavaScript was not working at all in Mozilla Firefox. In my case the solution was simply to comment out jQuery Address for now and I will need to upgrade it later on. I was surprised that Mozilla Firefox was rigid about it and all other browsers were flexible to allow the jQuery/JavaScript code to continue to work.
<script type="text/jscript">
is probably not going to fire in Firefox: JScript is Internet Explorer's interpretation of JavaScript. Use
<script type="text/javascript">
Other than that, it looks like it should work fine (even though it would be really better and cleaner to have this stuff in the head
part.)
If one jQuery(document).ready block has an error inside it, later document.ready blocks do not get performed.
For example, if one wordpress plugin does error out inside its own jQuery(document).ready, then all following jQuery blocks in other plugins may start failing.
Firefox 18, Chrome 23, Opera 12 behaves this way. jQuery v1.7.2
Recently it caused some trouble to me, and I can't imagine why I never had to deal with this before.
Possibly it is a jQuery bug/unintended behaviour.
I'm afraid I have no idea about how to fix the $(document).ready
function, but this question has some possible solutions on how to work around it. Not sure if that's what you're looking for.
Btw, you can write it even shorter:
$(function() {