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: |
Description
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 -
https://gist.github.com/268257
It would be worth updating the link.
Change History (6)
comment:1 Changed 12 years ago by
Component: | unfiled → web |
---|---|
Owner: | set to jdsharp |
Priority: | undecided → low |
comment:3 Changed 12 years ago by
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
Owner: | changed from jdsharp to kswedberg |
---|---|
Status: | new → assigned |
Assigning to Karl
comment:5 Changed 12 years ago by
Milestone: | 1.next |
---|---|
Version: | 1.5 |
comment:6 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
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.