Hacker News new | ask | show | jobs
by gregschlom 5586 days ago
Now, a bookmarklet would be really nice!

Just sayin'...

2 comments

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!