Bug Tracker

Ticket #11733 (closed enhancement: fixed)

Opened 4 years ago

Last modified 15 months ago

Deprecate .load(), .unload(), and .error() methods

Reported by: dmethvin Owned by:
Priority: low Milestone: 1.8
Component: event Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:


These are shortcut names for $().bind("load", fn) etc.

  • The .load() method is an ambiguous signature, it can either be an ajax load or attach/fire a "load" event. CCAO cannot tell them apart since it's a dynamic decision based on arguments.
  • If .load() is being deprecated, .unload() should be as well.
  • The .error() method has never worked to attach a window.onerror event since the function signature is not the same as a standard event handler. It may also be confused with jQuery.error() which is not related.

Change History

comment:1 Changed 4 years ago by dmethvin

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to event
  • Milestone changed from None to 1.8

comment:2 Changed 4 years ago by dmethvin

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

Docs updated.

comment:3 Changed 2 years ago by devdanke@…

From the deprecation documentation above, I do not know if jQuery has stopped supporting the "load" and "unload" events, or just stopped supporting the load() and unload() methods.

The reason I'm interested is because when I bind a handler function using unload() in a mobile browser Safari, Chrome, Firefox on iOS 4.x and Android 4.x, the handler is not called.

comment:4 Changed 2 years ago by dmethvin

The ticket title says "Deprecate .load(), .unload(), and .error() methods" and that is what it meant. The methods, not the events.

For support regarding problems, ask on the forum or StackOverflow.

comment:5 follow-up: ↓ 6 Changed 22 months ago by anonymous

What event handler will be used if load() has been deprecated? I am building on latest jquery2.0

comment:6 in reply to: ↑ 5 Changed 15 months ago by Max Nanasy

Replying to anonymous:

What event handler will be used if load() has been deprecated? I am building on latest jquery2.0

You can use $(window).on("load", callback)

Note: See TracTickets for help on using tickets.