Side navigation
#8619 closed bug (fixed)
Opened March 24, 2011 04:05PM UTC
Closed March 24, 2011 07:29PM UTC
Documentation for .error() is incorrect.
Reported by: | jvz | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The documentation on the .error() function gives the following example code:
$("img").error(function(){ $(this).hide(); });
However, its intended purpose of hiding broken images in Internet Explorer works in every browser ''but'' IE. I've tested this in Safari 5.0.4, Opera 11.01, Firefox 4.0, and Chrome 10.0.648.151. The bug is in at least IE 8.0 and IE 9.0 (the only versions of IE I have access to at work right now), but knowing IE, it's probably also a bug in every other version.
In IE 9 at least, it only works sometimes due to a race condition pointed out in my previous bug report. Repeated testing in the working web browsers do not appear to exhibit this race condition and will still fire an error event after the image has already been loaded if an error handler is registered (which makes a lot more sense).
Attachments (0)
Change History (3)
Changed March 24, 2011 04:09PM UTC by comment:1
Changed March 24, 2011 04:13PM UTC by comment:2
component: | unfiled → event |
---|---|
priority: | undecided → low |
status: | new → open |
Changed March 24, 2011 07:29PM UTC by comment:3
resolution: | → fixed |
---|---|
status: | open → closed |
Original report was #8617.
I agree on the docs at http://api.jquery.com/error/ and have updated them.
Unfortunately, the "error" event does not seem to bubble in any browsers (although the W3C says it should) so you can't use delegate/live to handle them.
Here's a jsFiddle test case