Skip to content

Comment on JQuery plugin dynamically changes your images to placeholder kittens

Comments

Now, a bookmarklet would be really nice!

Just sayin'...

Here, this one will work without requiring jQuery:

  javascript:(function(){var a=document.getElementsByTagName('img'),i=a.length;while(b=a[--i]){b.setAttribute('src','http://placekitten.com/'+b.width+'/'+b.height);}})();

Thanks. Perfect match with http://ft.com and http://nytimes.com. Gives me a good laugh :)

javascript: void $('img').each(function(i,img) { var $i = $(img), w = $i.width(), h = $i.height(); if ( w && h ) img.src = 'http://placekitten.com/+w+/+h;});

Paste that in foxnews.com!

syntax error, this should work;

    javascript:(function(){$('img').each(function(i,img){var $i = $(img), w = $i.width(), h = $i.height(); if ( w && h ){img.src = 'http://placekitten.com/'+w+'/'+h;}});})()

Hah!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.