Bug Tracker

Modify

Ticket #1311 (closed enhancement: fixed)

Opened 6 years ago

Last modified 5 years ago

$(document).unbind('ready');

Reported by: jimmont Owned by:
Priority: major Milestone: 1.2.2
Component: event Version: 1.1.2
Keywords: document ready bind unbind onload Cc:
Blocking: Blocked by:

Description

In a script I initialize functions using the ready event: $(document).ready(function(){ }); $().ready(functionReference);

Is it possible to change the behavior of the ready event to be more like other events (eg click) so that the following will remove the previous functionality (and prevent it from happening)? (In this scenario I see the previous code as loaded from an external script, then a subsequent script does the unbinding and attaches new functionality to the page.)

$().unbind('ready'); $(document).unbind('ready');

This is a followup to the dialog at:  http://groups.google.com/group/jquery-en/browse_thread/thread/f01888f1bcd54531?hl=en

thanks very much

Change History

comment:1 Changed 6 years ago by john

  • Type changed from bug to enhancement

comment:2 Changed 5 years ago by brandon

  • Milestone changed from 1.2 to 1.2.2

I've started work on this in the  events_enhancement branch.

comment:3 Changed 5 years ago by brandon

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

This functionality is now available in 1.2.2+

Although you must use the typical bind syntax in order to use the unbind syntax.

$(document).bind('ready', fn); $(document).unbind('ready', fn);

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.