Bug Tracker

Opened 12 years ago

Closed 12 years ago

#8162 closed feature (fixed)

jQuery Load Event linking to bad code

Reported by: guybedford Owned by: kswedberg
Priority: low Milestone:
Component: web Version:
Keywords: Cc: paul_irish
Blocked by: Blocking:


The jQuery events page links to an image load plugin on this page:

http://api.jquery.com/load-event/ to https://github.com/peol/jquery.imgloaded/raw/master/ahpi.imgload.js

I spent a good amount of time trying to get the above to work like so: $('.container img').load(function(){ $(this).fadeIn(); });

Unfortunately it was giving an error as $('img') isn't the exact element (you need to use $('img')[0]) and hence it fails the initial Tag Name check in the code.

I ended up using the newer version here -


It would be worth updating the link.

Change History (6)

comment:1 Changed 12 years ago by addyosmani

Component: unfiledweb
Owner: set to jdsharp
Priority: undecidedlow

As mentioned by desandro in one of the gists, if you want the images as context inside the callback, then you should be using paul_irish's original version. That said the ajpi.imgload.js file is specifically noted as being broken at the moment so we may end up removing the reference to it completely. I'll speak to paul_irish and peol before we commit to making any changes here.

comment:2 Changed 12 years ago by addyosmani

Cc: paul_irish added

CC'ing paul_irish for his input on this.

comment:3 Changed 12 years ago by jitter

Huh? Why do we even have a link to a "3rd party" plugin on the official api documentation? We also don't link to e.g. https://github.com/brandonaaron/jquery-cssHooks on the .css/.animate pages.

I opt for removing this link.

comment:4 Changed 12 years ago by jdsharp

Owner: changed from jdsharp to kswedberg
Status: newassigned

Assigning to Karl

comment:5 Changed 12 years ago by jitter

Milestone: 1.next
Version: 1.5

comment:6 Changed 12 years ago by addyosmani

Resolution: fixed
Status: assignedclosed

I've gone in and removed the blockquote where we reference peol's special events plugin for image loading. Given that a) it's stated as broken on GitHub and b) we probably shouldn't be referencing third party plugins unless we're sure they're working with the current stable release, it doesn't make sense to be recommending it. Please feel free to revert this change if you disagree.

Note: See TracTickets for help on using tickets.