Skip to main content

Bug Tracker

Side navigation

#11733 closed enhancement (fixed)

Opened May 08, 2012 07:40PM UTC

Closed May 21, 2012 03:29AM UTC

Last modified August 27, 2014 08:07AM UTC

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

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

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.
Attachments (0)
Change History (6)

Changed May 08, 2012 07:41PM UTC by dmethvin comment:1

component: unfiledevent
milestone: None1.8
priority: undecidedlow
status: newopen

Changed May 21, 2012 03:29AM UTC by dmethvin comment:2

resolution: → fixed
status: openclosed

Docs updated.

Changed May 30, 2013 09:10PM UTC by devdanke@gmail.com comment:3

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.

Changed May 30, 2013 09:15PM UTC by dmethvin comment:4

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.

Changed February 05, 2014 11:58PM UTC by anonymous comment:5

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

Changed August 27, 2014 08:07AM UTC by Max Nanasy comment:6

Replying to [comment:5 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)