Cool things you can do in Javascript

Talk about anything you want, but keep it within the rules, please.
User avatar
matchai
Forum Staff
Posts: 1009
Joined: July 14th, 2007, 2:51 pm

Cool things you can do in Javascript

Post by matchai »

Put these in your address bar and press enter to use them:

Modify the website in realtime:

Code: Select all

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
TORNADO:

Code: Select all

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0);
Spoof site checker:

Code: Select all

javascript:alert("The actual URL is:\t\t" + location.protocol + "//" + location.hostname + "/" + "\nThe address URL is:\t\t" + location.href + "\n" + "\nIf the server names do not match, this may be a spoof.");
Post some of your own!
User avatar
Senethior459
Forum Staff
Posts: 2618
Joined: June 2nd, 2007, 6:53 pm
Title: I Just Lost the Game

Re: Cool things you can do in Javascript

Post by Senethior459 »

Translate to English (if you want to modify it for, say, German, change the &hl=en near the end to &hl=de, or whatever language you want it to translate to):

Code: Select all

javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=auto|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=auto|en&tbb=1&ie='+e;};
Readability (turns a page into a much more readable one, if you don't like my settings, make your own at http://lab.arc90.com/experiments/readability/ ):

Code: Select all

javascript:(function(){readStyle='style-ebook';readSize='size-medium';readMargin='margin-narrow';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='screen';document.getElementsByTagName('head')[0].appendChild(_readability_css);_readability_print_css=document.createElement('LINK');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_css);})();
Link Shortener using the Goo.gl service:

Code: Select all

javascript:window.googl_callback%20=%20function(response){if(response.error_message){alert("An%20error%20occured:%20"%20+%20response.error_message);}else{alert(response.short_url);}};%20var%20s%20=%20document.createElement("script");%20s.src%20=%20"http://ggl-shortener.appspot.com/?url="%20+%20encodeURIComponent(window.location.href)%20+%20"&jsonp=googl_callback";%20void(document.body.appendChild(s));
My Warcraft III Tool Collection
If you want to chat/game with me:
Blizzard: Senethior459#1962
Discord: Kyle#7409
Steam: Spacekidkyle