#13305 closed bug (notabug)
jQuery does not run SPECIFIC code in second $(document).ready()
Reported by: | waddlesplash | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In jQuery 1.9.0, I have the following two $(document).ready()
functions:
$(function() { $('.dropdown-toggle').dropdown(); // twitter bootstrap });
Between the two, there are </script>
and <script>
tags and numerous other tags in between. And I need these two to be in the different locations that they are, and in two separate <script>
tags.
$(function() { $('#load').hide(); $('#ok').hide(); $('#bad').hide(); $("#user").focusout(function() { alert("I got here!"); /* the above code never runs... */ }); });
All code in both except for the $("#user").focusout
runs. If the first $(document).ready()
is commented out, THEN the $("#user").focusout
runs. But not otherwise.
Change History (3)
comment:2 follow-up: 3 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
You can't quick-close <script />
tags. The script block is eaten by that.
comment:3 Changed 10 years ago by
Whoops. But that was just for jsBin, my real <head>
code does not have that.
For some reason, it all now works in both places (without any changes from me in the desktop part). I hate bugs that fix themselves, so I may be back if it somehow reappears...
Here's a jsFiddle with all JS files included. The addition of
bootstrap.js
is what seems to break this, why? Everything else works. This still appears to be jQuery's problem as the addition of a plugin should not break this...