Javascript Does Not Load In Initial Page Load
Solution 1:
Fire up firebug and see if you're actually getting Javascript sent down the wire. Is there a 404 or 500 whooshing by? Or is code loading correctly? Is your event handler being called? Add a console.log
or alert
to your handler to test. Is your handler even being attached? Did you put the whole thing in a $(document).ready()
? Did you put your script after the jquery.js
file, so that jQuery is available when your script attaches event handlers? In general, you know, do that debugging thing we all love so much.
Solution 2:
If your problem is occurring in IE8, you should:
- try to use the normal version o jQuery (instead of the minified one)
- in IE's advanced options, make sure that disable script debugging isn't checked
- fire up IE's developer tools (shortcut for that should be F12) and start script debugging
- using the script debugger, try to understand the stack where IE is firing up the error, namely what's jQuery trying to do when the error is triggered
Once you have the thing that jQuery is trying to do when the error is triggered, you should be able to either workaround the issue or find that the bug is jQuery's and submit it to the project maintainers.
Post a Comment for "Javascript Does Not Load In Initial Page Load"