Skip to main content

Bug Tracker

Side navigation

#950 closed bug (wontfix)

Opened February 13, 2007 03:50AM UTC

Closed February 18, 2007 10:13PM UTC

Last modified June 20, 2007 03:01AM UTC

jQuery.fn.ready should not pass in any params to the functions pushed onto readyList

Reported by: dcpedit@hotmail.com Owned by:
Priority: minor Milestone:
Component: core Version:
Keywords: Cc:
Blocked by: Blocking:
Description

foo function(arg) {

alert(arg)

}

$("document").ready(foo);

// ready is passing in a function to foo, so the function code is displayed. arg should be null. This is the expected behavior and is neccessary if foo is a shared function.

Attachments (0)
Change History (1)

Changed February 18, 2007 10:13PM UTC by john comment:1

resolution: → wontfix
status: newclosed
version: 1.1a
// ready is passing in a function to foo, so the function code is displayed. arg should be null. This is the expected behavior and is neccessary if foo is a shared function.

That's correct. We added this such that you could call jQuery by any name within your program scope. For example:

  jQuery(document).ready($){
    $("div").hide();
  });

or:

  jQuery(function($){
    $("div").hide();
  });

So, yes, it doesn't behave like a normal event (in that it doesn't pass in an Event Object), but this event also isn't a normal event. In this case, we're taking advantage of that fact by providing an incredibly useful feature, for users who work in conflicting-code situations.