Ticket #7214 (closed bug: duplicate)
document jQuery.readyWait
| Reported by: | texec | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.5 |
| Component: | misc | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
jQuery.fn.ready contains no test for jQuery.readyWait, so readyWait is totally useless at the moment. Recommend fix:
jquery-1.4.3.js, line 280:
- if ( jQuery.isReady ) {
+ if ( jQuery.isReady && jQuery.readyWait <= 0 ) {
If not, I don't understand how to use readyWait and it should be better documented.
Change History
comment:2 Changed 3 years ago by snover
- Priority changed from undecided to low
- Status changed from new to open
- Component changed from unfiled to misc
- Summary changed from jQuery.fn.ready does not respect jQuery.readyWait to document jQuery.readyWait
comment:3 Changed 3 years ago by anonymous
I don't think so. It's very easy - if $() is called after the event fired your example fails.
comment:4 Changed 3 years ago by fbuchinger
@anonymous: your modified version of the readyWait sample fails because you used an invalid type attribute in your second script tag: <script type='txt/javascript'> instead of <script type='text/javascript'>. This causes the browser to ignore the script.
Nevertheless, the original version of the example is pretty weird.... jQuery.readyWait += 2 WTF??? - simply setting it to true would have made things more clear. Why is the first script in CDATA and the second not...? 2 explanatory comments along the jQuery.readyWait/jquery.ready(true) lines would have been nice
comment:5 Changed 3 years ago by snover
- Milestone changed from 1.4.4 to 1.4.5
Retargeting due to severity of regressions in 1.4.3.
comment:6 Changed 3 years ago by texec
@fbuchinger Oops, my mistake. But if you use this outside a testcase in a real world environment with large scripts this is 100% reproducible. Simply look at the code and check what happens if jquery.isReady is set before jquery.ready(function…) is called.
@snover: Retargeting due to severity of regressions in 1.4.3. This is a joke isn't it? We have too many bugs so we don't even try to solve the very simple ones?
comment:7 Changed 2 years ago by jitter
- Status changed from open to closed
- Resolution set to duplicate
Added info on #6781 that readyWait needs to be documented on api.jquery.com
comment:9 Changed 2 years ago by john
- Version changed from 1.4.3 to 1.5
There wasn't a 1.4.5 release, was actually 1.5.
comment:10 Changed 2 years ago by john
- Milestone changed from 1.4.5 to 1.5
There was no 1.4.5 release, was actually 1.5.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

I think this bug report is invalid.
readyWait sample to show usage of readyWait and that it is working as expected.