Blog Oh! Blog Blog Oh! Blog

0 SUBSCRIBERS

Today, I will list some very cool JavaScript hacks and tricks that you can use creatively or just have plain fun. To make each one of these codes work, all you have to do is copy and paste it into the address bar of your browser window and hit “Enter”. So here they are :-

Play the “Lord of the Web”

This code lets you edit any page/website in real-time :) . With Firefox, you can even edit and save the modified pages to your computer. Very nifty code!

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

The Big Wheel

This piece of code pulls off all the images from your web page and rotates them in a circle. Really makes any page go naked (without its images). The best place to test is a website with many images. (Google Images for an example)

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);

If you look carefully in the above code, its rotating the HTML “img” tag. Just replace it with “a” or “p” and watch some links or text rotate instead of images.

Tremors

Your browser will be very afraid of this code :) If the code below doesn’t seem to work, please replace > with > and < with <

javascript:function flood(n) {if (self.moveBy) {for (i = 200; i > 0;i–){for (j = n; j > 0; j–) {self.moveBy(1,i); self.moveBy(i,0);self.moveBy(0,-i); self.moveBy(-i,0); } } }}flood(6);{ var inp = “D-X !msagro na dah tsuj resworb rouY”; var outp = “”; for (i = 0; i <= inp.length; i++) {outp =inp.charAt (i) + outp ; } alert(outp) ;}; reverse

The Calculator

In case you are not in a mood to use the standard windows calculator and want your browser to do the dirty job for you, use this code.

javascript: alert(34343+3434-222);

You can change the numbers according to your choice and also try creative complex equations. Just put your arithmetic into javascript: alert( );

Finding Spoof Websites

There are times when you are not sure that the website that you are visiting is authentic. Use this code whenever in doubt :-

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.");

And finally here is something that you can only get to hear if you ever worked in a Tech Support department :(

  1. thanks for the tips, I will try to practice on my website

  2. I think this is the best of java script for web,,

  3. I liked The Calculator

  4. Write more, thats all I have to say. Literally, it seems as though you relied
    on the video to make your point. You definitely know what youre talking about,
    why waste your intelligence on just posting videos to your weblog when you could be giving us something informative to read?

  5. Hi there! This article couldn’t be written much better! Looking at this post reminds me of my previous roommate! He always kept talking about this. I most certainly will send this post to him. Fairly certain he will have a very good read. I appreciate you for sharing!

  6. Step 1: Go to high-quality store report and ne’er of all time buy card antics that contain controversial contents such as political and off-the-course humors. But this trick will motives is 16 card games from a steady acting deck of cards. The secret Focus is authoritative. Of class, if you execute these have hit specialized knowledge in the field of honor of medicinal drug. Cellulite is nothing but fat cadres existing trapped of facial facial expressions so that the audience pores on your look and cuts your fleet, sneaky hired hand social movements.

  7. […] Cool JavaScript Tricks. […]

  8. Thanks for finally talking about > Blog Oh Blog ? Blog Archive ? Cool JavaScript Tricks < Loved it!

  9. Throughout this grand pattern of things you receive a B+ just for hard work. Where exactly you misplaced me was first on the particulars. You know, as the maxim goes, details make or break the argument.. And that could not be much more correct at this point. Having said that, allow me tell you exactly what did do the job. Your writing is highly persuasive which is possibly the reason why I am taking an effort in order to opine. I do not really make it a regular habit of doing that. Secondly, although I can certainly notice the jumps in reasoning you come up with, I am not really sure of just how you appear to connect the details which in turn make the actual conclusion. For the moment I will subscribe to your issue however hope in the future you actually link the facts much better.

  10. […] credits: http://www.blogohblog.com/cool-javascript-tricks/ […]

  11. ???? left a comment on March 20, 2013 at 9:57 pm |

    Thank You For This Post I Like This Site And This Design :)

  12. Hi I wanted to show my really good travel website which is http://landed.at I hope you dont mind they accept blog posts.

  13. Do the Harlem Shake

    javascript:(function(){function c(){var e=document.createElement(“link”);e.setAttribute(“type”,”text/css”);e.setAttribute(“rel”,”stylesheet”);e.setAttribute(“href”,f);e.setAttribute(“class”,l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;te&&s.heightt&&s.width=w&&t<=b+w}function S(){var e=document.createElement("audio");e.setAttribute("class",l);e.src=i;e.loop=false;e.addEventListener("canplay",function(){setTimeout(function(){x(k)},500);setTimeout(function(){N();p();for(var e=0;e<O.length;e++){T(O[e])}},15500)},true);e.addEventListener("ended",function(){N();h()},true);e.innerHTML=" If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser. “;document.body.appendChild(e);e.play()}function x(e){e.className+=” “+s+” “+o}function T(e){e.className+=” “+s+” “+u[Math.floor(Math.random()*u.length)]}function N(){var e=document.getElementsByClassName(s);var t=new RegExp(“\\b”+s+”\\b”);for(var n=0;n<e.length;){e[n].className=e[n].className.replace(t,"")}}var e=30;var t=30;var n=350;var r=350;var i="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";var s="mw-harlem_shake_me";var o="im_first";var u=["im_drunk","im_baked","im_trippin","im_blown"];var a="mw-strobe_light";var f="//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";var l="mw_added_css";var b=g();var w=y();var C=document.getElementsByTagName("*");var k=null;for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){if(E(A)){k=A;break}}}if(A===null){console.warn("Could not find a node of the right size. Please try a different page.");return}c();S();var O=[];for(var L=0;L<C.length;L++){var A=C[L];if(v(A)){O.push(A)}}})()

  14. yaaaaaaaaaaaaaaaaaay

  15. Thanks for your efforts for testing, and feedback. In my browser IE6 problem still persists. May be due to some other reason. Anyways, thanks again.

  16. Fuck you

  17. Hmm is anyone else encountering problems with
    the pictures on this blog loading? I’m trying to determine if its a problem on my end or if it’s the blog.
    Any responses would be greatly appreciated.

  18. cool scripts …i am having fun wid your scripts….thanks for sharing

  19. It’s good
    XD

  20. window.onload=function(){
    document.body.contentEditabel=’true';
    document.designMode=’on';
    }

    XD

  21. Thanks for sharing your javascript tutorial

  22. thank you for share this article
    this is very help us

  23. thank you
    this is very help me
    good luck

  24. Thanks you man

  25. when i tried it it just searched it up

  26. Those codes has been not working on the modern browsers anyway

    • yes they do, atleast on mine. you cant copy paste it tho, you need to enter the whole thing by hand.

    • If you want to do it in chrome or FireFox, just go to any random website, add it as a bookmark, then click on the bookmark and click Edit. , then delete the URL and copy and paste the code into the URL box, then go to any website, click on the bookmark and now you can use that code for that site!

  27. […] building things for frontend developers, remember they’re working with one of the craziest languages we use regularly on the internet. JavaScript would re-scope your family if you gave it the chance. […]

  28. […] building things for frontend developers, remember they’re working with one of the craziest languages we use regularly on the internet. JavaScript would re-scope your family if you gave it the chance. […]

  29. The code that allows you to modify a page quickly is way off the hook. I will try it out in Chrome now. What a way to not waste time. Thanks

  30. Really cool tricks to try and share with friends to amaze them. Thanks for sharing these many.

  31. Sweet Tricks jai!

  32. Sweet Tricks jai!

  33. this websites a spoof the server names didnt match

  34. Hi there, You’ve done an excellent job. I will certainly digg it and personally suggest to my friends. I am sure they will be benefited from this web site.

  35. Too good post! These are really wonderful tricks we can use in our website. Thanks!

  36. Search This On Google! And Watch Wat Happens

    zerg rush

  37. yay google is my queen aided me to find this great website ! .

  38. Download-provider is spoof!

  39. vERY NICE I WOULD LIKE TO USE FOR MY WEBSITE http://homeoresearch.blogspot.com

  40. LOLZ, Lord of the web thingy with CTRL+A DEL
    (huh? where did it go???) =3

  41. everytime i try this my search bar automatically puts htpp://www. in front of the codes and then it dosent work can someone help me with this

  42. Really Cool trick, I use it my web site Bank Career in Bangladesh

  43. Those codes and tricks are really useful. Keep up the good work, expecting more updates from you

  44. hi, I read your post and it was amazing , KEEP IT, great job.

    Singapore Web Design Company

  45. hi, I read your post and it was amazing , KEEP IT, great job.

  46. Does this work with the newest versions of firefox, IE, chrome? i have been trying but to no avail. nothing happens.
    matteeboi@gmail.com

  47. Amazing Javascript: Image left to right: Go to address bar and paste this. After paste this code into address bar, you

    additionally type “javascript”.

    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);

  48. Really amazing tricks…. i like it.. thanks for sharing…

  49. not work with my browser,firefox and chrome…why? =(

  50. EPICness. I threw javascript on the groooound!

  51. Habib left a comment on December 18, 2011 at 3:48 am |

    EPIC

  52. http://thanigavelm.blogspot.com/

    javascript:function flood(n){if (self.moveBy){for (i = 50; i >0;i=i-2){for (j = n; j > 0; j=j-2){self.moveBy( 1,i );self. moveBy(i,0);self.moveBy( 0,-i);self. moveBy(-i, 0);}}}}flood(6);{var inp = ” ~***~ LEVAGINAHT rU MoRF~***~ NAM PU EKAW “;var outp = “”;for(i = 0; i <= inp.length; i++) {outp =inp.charAt (i) + outp;}alert(outp);};reverse

  53. good trics pls send more ……………….

  54. Small Payday Loan Lenders left a comment on November 17, 2011 at 7:28 pm |

    Hey, buddy, I have not figured out how to subscribe
    http://instantloansgroup.com/

  55. hey i got a problem all of the codes dont work on my computer i use firefox and chrome but none of these cods work please help me because i dont know how to use this and it sounds fun :( please reply

    • Its because when u copy the javascript line it will not copy the first part of the line that says “javascript:” you have to type it in by urself and then copy the code.

  56. Galen left a comment on November 7, 2011 at 5:26 pm |

    I couldn’t help noticing that when using the spinning image script, reloading the page doubled its speed 😀

  57. c left a comment on October 25, 2011 at 2:43 pm |

    ………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..

  58. nice one man.
    some more available @msvishnumkl.blogspot.com

  59. […] 5??????????Javascript?? By admin On 2011 ? 9 ? 9 ? · Leave a Comment ?????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? […]

  60. devaj left a comment on September 4, 2011 at 12:06 am |

    great tricks,thank you

  61. The code that allows you to edit a page in real time is way off the hook. I will give it a shot in Firefox now. What a time saver. Thanks

  62. Cc left a comment on July 2, 2011 at 10:30 am |

    more please loved using these on my school hompage! :) (^^^)

  63. Miles left a comment on June 14, 2011 at 3:24 pm |

    Dude! These are amazing! My friend put them on google images (big wheel) and it was friggin hilarious! Could someone tell me how to apply Big Wheel to a website? Thanks!

  64. The evil one left a comment on June 3, 2011 at 4:16 pm |

    Nice codes! Only thing is i can’t seem to get the tremors to work on IE, Firefox or chrome. Anyone got any ideas?

  65. lkj]n left a comment on May 29, 2011 at 1:53 am |

    very goooooooooooood

  66. The Big Wheel is amazing, but totally useless 😀

  67. very nice if you really want to build a exciting web page add some rotating script and some moving pictures (.gif) type but build them with java best of luck and have some fun. There are many of ways to make your website better

  68. very cool code..i enjoyed a lot..!thanks

  69. ?»?sacs en Suisse.

  70. […] This post was mentioned on Twitter by ako to jasmine, kaitoyutani. kaitoyutani said: http://www.blogohblog.com/cool-javascript-tricks/#jd […]

  71. thanks for sharing. great stuff

  72. these are really cool tricks send some more!!!!

  73. aastha left a comment on August 11, 2010 at 2:32 am |

    its very cool trics . please me more funny trics.

  74. wow,,, nice one…

    can give another tricks..

    thansxxxxxxx….

  75. Great post thanks!, found theese javascrips pretty useful, especaly the real time editor

  76. jay left a comment on April 28, 2010 at 12:27 am |

    Hey do you mind if I use some of this content on http://www.basicwebdesign.co.cc in exchange for a link back to your site? Thanks

  77. jay left a comment on April 24, 2010 at 9:00 am |

    love the tremors one

    • ME left a comment on August 8, 2010 at 9:29 pm |

      dude hw did u use the tremors one please can u help me out with it i use internet explorer 8 but the javascript doesn’t work plzz zhelp

  78. hehe really fun list of tricks !!

    Thanks

  79. secret left a comment on March 29, 2010 at 2:58 pm |

    @wuzhongkai:-
    cool……………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..href
    alert(document.cookie)

  80. alex left a comment on March 26, 2010 at 11:52 am |

    How can you embed one of this codes to work after clicking a specific link on my website?

    Respect!

  81. Anonymous left a comment on March 25, 2010 at 6:01 pm |

    None of them worked, errors:

    (1) Expected Objects
    (2) Did not close parenthesis
    (3) Did not define “document”

    These errors were found when saved from Notepad as the .js format, maybe I did that wrong? Hopefully you can fix that!

    Thanks!

  82. Jai left a comment on March 9, 2010 at 10:46 pm |

    @Anonymous:- Nice one there .

  83. Anonymous left a comment on March 9, 2010 at 12:59 pm |

    nice javascripts…..
    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*x3+x4)*x4+x5)+”px”; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+”px”}R++}setInterval(‘A()’,5); void(0);

    Try that one…pretty much the same as one before but i changed something…..enojy :)

  84. Helpful articles

  85. some cool trick here

  86. Wow!! thats really cool tricks!!

    visit: http://hacktutors.blogspot.com

    To know every hacking tricks.

    Thank YOu!!!

  87. help left a comment on October 16, 2009 at 2:45 pm |

    what is the lst ones code

  88. calculator ahahahahaha, this is joke I hope it is…. javascript: alert(34343+3434-222);

  89. […] ????:??????????Javascript????????10????javascript?????????????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog?[separator] […]

  90. Govind left a comment on September 4, 2009 at 12:17 am |

    Really thank you for sharing…
    Excellent…

  91. olly left a comment on August 8, 2009 at 7:50 pm |

    thxx that was fuuun!!

  92. Keep up the good work and all the very best for you future ventures..

  93. Myself left a comment on May 16, 2009 at 4:09 pm |

    Really fun

  94. no left a comment on April 1, 2009 at 3:21 pm |

    Images are flying much faster in Chrome then they are in IE. Wonder if it will be even faster with chrome v2

  95. Dexter left a comment on February 25, 2009 at 10:44 am |

    I can note something interesting with Google Notebook by selecting the text and just clicking a bookmark “javascript:(function(){var w=window;var d=document;var g=w.open(‘about:blank’,’gnotesWin’,’location=0,menubar=0,scrollbars=0,s”. However, Google Notebook limits the number of words in a single Note. I wonder if it’s possible to note text with Google Doc by clicking just a bookmark containing a set of javascript code?

  96. Nice tricks.. :)

  97. Thank you

  98. […] a quick little JavaScript trick that lets you edit page content from within FireFox. Copy and paste the following into your address […]

  99. Love the comic :)

    Thanks for the first trick. I just added it to my bookmarks and I’m sure it’ll get put to good use.

  100. […] ???????Javascript????????10????javascript???????? ?????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? 1????? ????????????enter??????????????????????????????????????????????????????NetDisater? ????? javascript:document.body.contentEditable=’true’; […]

  101. […] más todo lo que se puede lograr con el lenguaje, tan conocido, Javascript. Desde el sitio Blog Oh! Blog me encuentro con una serie de trucos de Javascript muy impresionantes y […]

  102. […] más todo lo que se puede lograr con el lenguaje, tan conocido, Javascript. Desde el sitio Blog Oh! Blog me encuentro con una serie de trucos de Javascript muy impresionantes y […]

  103. Nice Tips man
    Thx

  104. […] ???????Javascript????????10????javascript???????? ?????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? 1????? ????????????enter??????????????????????????????????????????????????????NetDisater? ????? javascript:document.body.contentEditable=’true’; […]

  105. […] ??????? ???? ???? ??? ?? ?????? ?????? ??? […]

  106. some of them are really interesting thanks

  107. […] ?????????Javascript??????????BlogOhBlog? […]

  108. The Tremors one doesn’t work for me (in Firefox 3.0 on Ubuntu Linux 8.04 Hardy Heron).

    Love the cartoon at the end!!

  109. Hah, really neat javascript tricks, I will give them a shot

  110. good tricks… keep it coming :)

  111. I found this bug that is belong to wordpress………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………..

  112. welcome to my website http://www.mihu8.cn Test………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….

  113. wow… superb..

    nice… thnx for sharring..

  114. Really your words are fantastic thanx
    http://www.roro44.com

  115. Hey good buddy
    i want more lyk these
    its a fun and ya ur blog is good source

  116. […] ???????Javascript????????10????javascript?????????????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? […]

  117. Very funny post. The tech guy image reminds me of our workplaces and when customers call up talking nonsense!

    The Finding Spoof Websites code sounds interesting so I will have to check that one out.

  118. Jacky left a comment on July 21, 2008 at 6:51 am |

    This passage is really cool and I translate it into Chinese and posted it in my website SPEWARE.cn . Thanks a million!! If you don’t like it, I will delete my translation.
    From the Trackback I guess your blog is hot in China. I think you can revise your plugin to let it support Chinese. My English is not very good. Thanks again!

  119. […] ???????Javascript????????10????javascript?????????????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? […]

  120. really cool! I’ve tried . tq…!!

  121. […] ???????Javascript????????10????javascript?????????????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? […]

  122. […] ??“??”????????????????????BlogOhBlog? […]

  123. […] ???????Javascript????????10????javascript?????????????????????Javascript???????????????????????????????????????Cookie????????????“??”????????????????????BlogOhBlog? […]

  124. how interesting information. cool…….

  125. javascript is good i like iit

  126. Thanks this interesting information!

  127. Steve left a comment on July 12, 2008 at 4:52 pm |

    @Steve:- Ha I wrote the same thing, replace &’gt; with > and &’lt; with <. Did it display differently that time?

  128. Steve left a comment on July 12, 2008 at 4:49 pm |

    He was saying to replace the > with > and < with <.

  129. Awesome. How this spoof finder script works. gr8.

  130. Rahul left a comment on July 10, 2008 at 4:18 am |

    Amazing tricks Jai , i mentioned the first trick in my blog post weeks back !

    Awesome list !

  131. tom left a comment on July 9, 2008 at 8:36 am |

    Notify me of followup comments via e-mail

  132. Beth left a comment on July 8, 2008 at 9:38 pm |

    Very interesting post – I don’t know that I want to make my browser very afraid, but I laughed and laughed at your comic at the end! Have a good day!
    Beth

  133. I often find something cool like this and think “Interesting, but I don’t think I could use this anywhere.” … well, I’m still thinking that here, BUT I have a feeling I actually will put one of those into something.

    I don’t get your instructions under Tremors. Replace what?

  134. Karlyn left a comment on July 8, 2008 at 9:45 am |

    Very handy, thank you!

  135. love the big wheel :)
    superb!

  136. Daniel left a comment on July 8, 2008 at 2:18 am |

    Sweet Tricks jai!
    Awsum!

  137. Yusuf left a comment on July 7, 2008 at 4:32 pm |

    you just made my day jai!!!! nifty, very nifty!!!!

Leave a Comment

Your email address will not be published. Required fields are marked *

What Others Say

BannerJai was awesome to work with. A port of an ASPX/HTML site to Wordpress went seamlessly, and his recreation of our look and feel were fantastic - Kevin Webster

BannerJai is a talented, creative and an enthusiastic web developer who has worked consistently to deliver high quality websites for my businesses - James Eccles

Have Questions?Hire Me

Send Me Your Questions

Tell Me About Your Project