Reputation: 1
I am currently programming a page and run over a strange problem with Firefox...
The issue is that when I put the document.ready function directly after the script statement Firefox hangs up (stating continuously that it loads data from the page but doing nothing):
<script language="JavaScript" type="text/JavaScript">
$(document).ready(function(){
...do something...
});
As soon as I put an empty line or a comment line after the satement everything is running fine:
<script language="JavaScript" type="text/JavaScript">
// empty (or comment) line needed to keep Firefox running
$(document).ready(function(){
...do something ...
});
There is no change in the behavior when I reduce the script statement just to <script>
- same effect.
I am using Firebug, but Firebug does not tell me anything and switching Firebug off changes also nothing.
In IE everything is running fine.
As mentioned I found a workaround by adding one empty line but my question is if anyone has experience the same issue and why this happens or if something in my code is wrong.
(I am using FF20.0)
Upvotes: 0
Views: 566
Reputation:
You need a closing tag
<script language="JavaScript" type="text/JavaScript">
$(document).ready(function(){
...do something...
});
</script>
Upvotes: 1