Bug Tracker

Modify

Ticket #2069 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

ready issues

Reported by: joern Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

I've discovered two issues with 1.2.2b with the ready event:

For once, the event handler doesn't get a reference to jQuery anymore, instead only a (useless for me) event object is passed.

Test:

test("jQuery(function($) {})", function() {
	stop();
	jQuery(function($) {
		equals(jQuery, $, "ready doesn't provide an event object, instead it provides a reference to the jQuery function, see http://docs.jquery.com/Events/ready#fn");
		start();
	});
});

The above test fails due to another issue: Binding a ready event after the event was issued doesn't do anything anymore. In 1.2.1 the handler would be triggered immediately. Though this behaviour isn't documented anywhere, but changing it definitely breaks stuff, so we should be the docs, too. Eg. adding this to  http://docs.jquery.com/Events/ready#fn:

<p>If the handler is bound after the event already fired, it is triggered immediately.</p>

No idea how to fix it due to the new special event handling. An introduction to that would be great.

Attachments

2069.diff Download (2.1 KB) - added by davidserduke 5 years ago.
possible patch

Change History

Changed 5 years ago by davidserduke

possible patch

comment:1 Changed 5 years ago by brandon

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [4211].

The ready helper method and associated shortcuts act the same as they always have. Using the events API to bind/unbind/trigger the ready event on the document follows the standards within the events API.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.