Created
January 17, 2010 01:48
-
-
Save ericclemmons/279143 to your computer and use it in GitHub Desktop.
Replace "Need some examples?" with actual examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Eric Clemmons | |
Library: jQuery 1.3.2 | |
When visiting "http://www.netflix.com/TastePreferences?lnkctr=wnph_sc_tst", I found myself | |
Clicking each "Click for example" link to better select my preference. | |
So, this script simply replaces that link with the first THREE suggested movie images. | |
Just Copy-Paste into Firebug & Run! | |
*/ | |
jQuery('.taste-cat').find('a.ex-link').each(function(i, link) { | |
jQuery.ajax({ | |
url: 'http://www.netflix.com/JSON/TasteCategoryExamples?size=small&verbose=true', | |
data: { | |
'tasteid': jQuery(this).attr('class').match(/ex-(\d+)$/)[1] | |
}, | |
context: jQuery(link).parent(), | |
dataType: 'json', | |
success: function( response ) { | |
var images = jQuery( response.html ).find( 'img:lt(3)' ); | |
jQuery( this.context ).empty().append( images.slice(0, 3) ); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment