Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#7214 closed bug (duplicate)

document jQuery.readyWait

Reported by: texec Owned by:
Priority: low Milestone: 1.5
Component: misc Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

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 (10)

comment:1 Changed 10 years ago by jitter

I think this bug report is invalid.

readyWait sample to show usage of readyWait and that readyWaitis working as expected.

Version 2, edited 10 years ago by jitter (previous) (next) (diff)

comment:2 Changed 10 years ago by snover

Component: unfiledmisc
Priority: undecidedlow
Status: newopen
Summary: jQuery.fn.ready does not respect jQuery.readyWaitdocument jQuery.readyWait

comment:3 Changed 10 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 10 years ago by fbuchinger

@anonymous: yourmodified 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 10 years ago by snover

Milestone: 1.4.41.4.5

Retargeting due to severity of regressions in 1.4.3.

comment:6 Changed 10 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 10 years ago by jitter

Resolution: duplicate
Status: openclosed

Added info on #6781 that readyWait needs to be documented on api.jquery.com

comment:8 Changed 10 years ago by jitter

Duplicate of #6781.

comment:9 Changed 9 years ago by john

Version: 1.4.31.5

There wasn't a 1.4.5 release, was actually 1.5.

comment:10 Changed 9 years ago by john

Milestone: 1.4.51.5

There was no 1.4.5 release, was actually 1.5.

Note: See TracTickets for help on using tickets.