I have a page where I import most of my js in the <head>
section.
The main page, however, has some inline javascript.
In one of my scripts imported in the <head>
, I have $(document).ready...
which uses some JS variables defined inline on the page.
As far as I can see, this works as I would expect -- $(document).ready
doesn't run into any errors using the JS vars defined inline.
However, I have gotten some reports from users that they see " is not defined" error in code inside my $(document).ready
where I reference the variable defined inline on the page.
I suspect this is browser specific behavior, but I'm not sure. I didn't find this explicitly in documentation, so can someone confirm that it's OK to use variables defined inline on a page in $(document).ready
in JS pulled in from the <head>
?
Citing your source would make your answer more credible. :)
Thanks!