CodeWalrus

Development => Web => Topic started by: Snektron on January 15, 2015, 02:51:35 PM

Title: Batman
Post by: Snektron on January 15, 2015, 02:51:35 PM
I made this little script:

javascript:var url='http://fc08.deviantart.net/fs71/f/2012/213/7/5/batman_derp_by_uchihirokilove-d59h7in.png';for (var x=0; x<document.images.length; x++){i=document.images[x];i.src = url;}void(0);

paste this into your browser and don't forget to type 'javascript:' before it if
you are using Chrome!
Title: Re: Batman
Post by: Dream of Omnimaga on January 15, 2015, 03:13:38 PM
Could you describe what it does? I probably won't try until then.
Title: Re: Batman
Post by: Snektron on January 15, 2015, 03:55:04 PM
It replaces every photo (clientside) on a website
to batman (reloading resets is).
Title: Re: Batman
Post by: Dream of Omnimaga on January 15, 2015, 04:47:45 PM
Ah ok thanks for clarifying.
Title: Re: Batman
Post by: Duke "Tape" Eiyeron on January 15, 2015, 05:12:05 PM
;i.src = url;}void(0);]Url test (http://javascript:javascript:var%20url='http://fc08.deviantart.net/fs71/f/2012/213/7/5/batman_derp_by_uchihirokilove-d59h7in.png';for%20(var%20x=0;%20x<document.images.length;%20x++)%7Bi=document.images%5Bx)

The parser is lucky, by adding http://, it kills the script.
Title: Re: Batman
Post by: p2 on October 17, 2016, 09:26:09 AM
omg this script is just awesome :D And it still works in modern browsers *-* really nice work!  :thumbsup:
But is there any way to fix the image sizes? it more or less killed my CodeW with 1000 huge batmans xD
Title: Re: Batman
Post by: Dream of Omnimaga on November 03, 2016, 06:01:13 PM
I finally got the script to work for the first time ever. I realized I didn't need parentheses in Chrome, just adding javascript: instead of the usual javascript:() now works.

I replaced the picture with http://img.codewalr.us/flashywalruses.gif tho :P

(https://tg.lolis-in.space/file_222.jpg)
Title: Re: Batman
Post by: kotu on November 03, 2016, 06:02:37 PM
me - i already know what batman looks like
Title: Re: Batman
Post by: WholeWheatBagels on November 04, 2016, 01:14:12 AM
javascript:var url='https://1800nycbagels.com/wp-content/uploads/2015/05/WholeWheatBagel_web1.jpg';for (var x=0; x<document.images.length; x++){i=document.images[x];i.src = url;}void(0);

this one really borks threads up

i call it BAGELIFY muhahahahaaa
Title: Re: Batman
Post by: Snektron on November 22, 2016, 11:43:40 AM
I got bored in class today. For me they only work when you paste them in your dev console though
function getRandomColor()
{
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++ )
color += letters[Math.floor(Math.random() * 16)];
return color;
}

var all = document.getElementsByTagName("*");
for (var i=0, max=all.length; i < max; i++)
all[i].style.backgroundColor = getRandomColor();

function getRandomColor()
{
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++ )
color += letters[Math.floor(Math.random() * 16)];
return color;
}

function a()
{
var all = document.getElementsByTagName("*");
for (var i=0, max=all.length; i < max; i++)
all[i].style.backgroundColor = getRandomColor();
}
setInterval(a, 60);


epilepsy warning