Jul
07

Cool JavaScript Tricks

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 :(

This post was viewed 212,714 times

94 Comments to “Cool JavaScript Tricks” | Leave a Comment!

  1. Andy says:

    Search This On Google! And Watch Wat Happens

    zerg rush

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

  3. Download-provider is spoof!

  4. toms says:

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

  5. Adam says:

    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

  6. Kader says:

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

  7. Gautham says:

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

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

    Singapore Web Design Company

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

  10. matt wilde says:

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

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

  12. cad2print says:

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

  13. thw says:

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

  14. Habib says:

    EPICness. I threw javascript on the groooound!

  15. THANI says:

    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

  16. AMar says:

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

  17. Small Payday Loan Lenders says:

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

  18. jeremy says:

    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

    • Dtard says:

      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.

  19. Galen says:

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

  20. c says:

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

  21. vishnu says:

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

  22. devaj says:

    great tricks,thank you

  23. outsource says:

    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

  24. Cc says:

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

  25. Miles says:

    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!

  26. The evil one says:

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

  27. lkj]n says:

    very goooooooooooood

  28. Patrick says:

    The Big Wheel is amazing, but totally useless :D

  29. Victor says:

    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

  30. vivek says:

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

  31. IT Village says:

    thanks for sharing. great stuff

  32. beginner says:

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

  33. aastha says:

    its very cool trics . please me more funny trics.

  34. leonard says:

    wow,,, nice one…

    can give another tricks..

    thansxxxxxxx….

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

  36. jay says:

    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

  37. jay says:

    love the tremors one

    • ME says:

      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

  38. tot2ivn says:

    hehe really fun list of tricks !!

    Thanks

  39. secret says:

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

  40. alex says:

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

    Respect!

  41. Anonymous says:

    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!

  42. Anonymous says:

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

  43. SMiGL says:

    Helpful articles

  44. Anup says:

    Wow!! thats really cool tricks!!

    visit: http://hacktutors.blogspot.com

    To know every hacking tricks.

    Thank YOu!!!

  45. help says:

    what is the lst ones code

  46. oleee says:

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

  47. Govind says:

    Really thank you for sharing…
    Excellent…

  48. olly says:

    thxx that was fuuun!!

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

  50. no says:

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

  51. Dexter says:

    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?

  52. Ryan says:

    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.

  53. arvind says:

    Nice Tips man
    Thx

  54. MOin says:

    some of them are really interesting thanks

  55. Blake says:

    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!!

  56. DInflux Ed says:

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

  57. Nadim Khan says:

    good tricks… keep it coming :)

  58. wuzhongkai says:

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

  59. wuzhongkai says:

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

  60. ruben says:

    wow… superb..

    nice… thnx for sharring..

  61. roro44.com says:

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

  62. Sarv007 says:

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

  63. Rachael says:

    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.

  64. Jacky says:

    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!

  65. mascayo says:

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

  66. the gands says:

    how interesting information. cool…….

  67. flashgames89 says:

    javascript is good i like iit

  68. Thanks this interesting information!

  69. Steve says:

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

  70. Steve says:

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

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

  72. Rahul says:

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

    Awesome list !

  73. tom says:

    Notify me of followup comments via e-mail

  74. Beth says:

    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

  75. 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?

  76. Karlyn says:

    Very handy, thank you!

  77. Tech news says:

    love the big wheel :)
    superb!

  78. Daniel says:

    Sweet Tricks jai!
    Awsum!

  79. Yusuf says:

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


Websites that Link to this Post

  1. You Wish Your Site Was This Cool » Week 9: More JavaScript
  2. 5??????????Javascript?? | wwt blog
  3. Tweets that mention Cool JavaScript Tricks | Blog Oh Blog -- Topsy.com
  4. 5??????????JavaScript?? | shu-live
  5. Editing a page from FireFox » Forums, Blogs, Wikis
  6. 5??????????JavaScript?? at ThinkiP!
  7. Truco Javascript para hacer rotar las imágenes de un sitio web… - dsd2hosting.com
  8. Truco Javascript para hacer rotar las imágenes de un sitio web - elWebmaster.com
  9. axengine » Blog Archive » 5??????????JavaScript??
  10. ????? ????????? ????? ????
  11. XINS`s Blog » Blog Archive
  12. Azone’s Blog » Blog Archive » 5??????????JavaScript??
  13. 5 Cool JavaScript Tricks - ??·??
  14. 5??????????JavaScript?? | SongsoSpace
  15. Okiba » Blog Archive » 5??????????JavaScript??
  16. 5??????????JavaScript?? | ThinkIP™
  17. 5??????????JavaScript?? » ?????

Leave a comment

Search :
Browse :
Archive :

$$$ Make Money $$$

Become an Affiliate

Welcome to Blog Oh! Blog's affiliate program! I personally invite you to make money by selling all of Blog Oh! Blog's Premium themes.

You will get a whopping 25% share on each sale generated through your affiliate link.

All you need to do is sign up as Blog Oh! Blog's affiliate, choose a banner, paste it on your website or blog and wait for sales to happen. It's as simple as that!

All affiliates will be paid on 10th of every month. Your affiliate earning needs to be a minimum $50 to get paid for each month.

Here is the sign up link and here are some banners to get you started!