I am testing my script in IE9. I noticed that $(document).ready is not always being called. That means 1 out of 8 times the function referred by $(document).ready is not being called.
As soon as I move the $(document).ready call to the end of the document, it works perfectly. The problem arises only if I move the $(document).ready call to the section.
I read through the blog post that confirms this problem in IE6: http://webbugtrack.blogspot.ca/2007/08/bug-153-self-closing-script-tag-issues.html
Considering the reputation of JQuery, I am surprised by the issue. Is this a known issue/bug and workaround for JQuery? Or am I missing anything?
Thank you,
UPDATE:
I just wanted to update with regards to this issue:
The script was working fine on the other browsers (Chrome and FF), only my dev machine's IE was problematic. Once I reset IE (reset and restore on the IS settings’ advanced tab) $(document).ready started to work as expected. So I know the solution, but I like to know the root cause.
While I am disappointed on IE’s shaky behavior, this case is left with an unanswered question: One of IE’s setting changes the way that $(document).ready behaves, and it causes the problem I explained in this post. Does anybody know which setting cased this issue?