Skip to main content

Bug Tracker

Side navigation

#3666 closed enhancement (fixed)

Opened November 29, 2008 06:26PM UTC

Closed December 25, 2008 05:38PM UTC

Last modified December 25, 2008 05:38PM UTC

Remove dead code from $(fn) shortcut for $(document).ready(fn)

Reported by: geary Owned by: flesler
Priority: trivial Milestone: 1.3
Component: core Version: 1.2.6
Keywords: Cc: geary
Blocked by: Blocking:
Description

The code for the $(fn) shortcut is:

return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );

It's unclear what the intent of this code was, but the jQuery.fn.ready test has no effect. jQuery.fn.ready always exists, so the code is the equivalent of:

return jQuery( document ).ready( selector );

That also matches people's expectation that $(fn) is the exact equivalent of $(document).ready(fn).

The attached patch removes this dead code.

Attachments (1)
  • readyshortcut.patch (0.4 KB) - added by geary November 29, 2008 06:28PM UTC.

    Patch to remove dead code from $(fn)

Change History (3)

Changed December 03, 2008 02:08PM UTC by flesler comment:1

cc: → geary
owner: → flesler
status: newassigned

Changed December 25, 2008 05:38PM UTC by flesler comment:2

resolution: → fixed
status: assignedclosed

Applied at [5997]. Thanks.

Changed December 25, 2008 05:38PM UTC by flesler comment:3

type: bugenhancement