JavaScript in address bar, trick to make images in a web page dance

I recently found this funny JavaScript code which will make the Images on any page go in a ring like dance. I got it through an e-mail forward, so I don’t know whom to credit. All you have to do is
1. Go to an Image rich page (eg:search for flowers in Google Images)

2. Paste the following Javascript code in the address bar and press ENTER (GO).

Copy this script and paste on adress bar:


What happens :

Make images in a page with JavaScript inserted from the above box
Let us examine the script to know what happens. In all the Browsers if a JavaScript code is embedded in the adress bar it can be executed as if it were in the page itself. This has also caused many vulnerabilities. That is a long story so lets come back.

The JavaScript makes an Array DI with all images as objects, then finds the number of images in the page and goto a loop which will change the position of the images one by one to a position given by the X and Y cordinates DIS.left=Math. sin(R*x1+ i*x2+x3)* x4+x5 nad DIS.top=Math. cos(R*y1+ i*y2+y3)* y4+y5}R++ }setInterval( ‘A()’,5); This goes on and we see the images going in a bend dumbbell.

Some related articles you may like :

  1. How to disable Right Click on a Web Page – with HTML
  2. How to save copy righted Images from Flickr
  3. Blogger Play – view images being uploaded to Blogger
  4. Blogger template tags to customize your layout and design
  5. Why is my template selection page in WordPress showing cryptic CSS
  6. Subscribe to the Email Newsletter
  7. Address bar shortcuts in Firefox
  8. Browser hogging CPU when taking wordpress write post page!

This entry was posted in Uncategorized and tagged Funny, Hacks, Image, Tips. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

17 Comments

  1. michael jones
    Posted September 17, 2011 at 9:56 AM | Permalink

    everytime I type it in it just searches the javascript codes on google

  2. michael jones
    Posted September 17, 2011 at 9:55 AM | Permalink

    dude it doesnt work

  3. Posted May 28, 2011 at 10:24 PM | Permalink

    Code to put all elements to “dance”:
    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(“*”); 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);

    For text (the most common elements that contain text):
    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(“p”, “a”, “input”, “h1″, “h2″, “h3″, “strong”, “b”, “i”, “u”, “strike”, “em”, “q”); 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);

  4. Posted April 13, 2010 at 10:17 PM | Permalink

    Sorry David, your comment didn’t make it :( Of late Firefox has started to become unstable, that’s why I copy the content of any form before submitting.

  5. Posted April 13, 2010 at 2:51 PM | Permalink

    Dang
    I just spent ages typing a long comment, and when I tried to send it my FireFox did something really weird.
    Did it come though or do I need to redo it?

  6. Posted December 6, 2009 at 12:15 AM | Permalink

    The code won’t work now. sorry/
    .-= Ajith´s last blog ..How to disable access to Drives using Disk Management =-.

  7. TeckiSan
    Posted December 1, 2009 at 9:43 PM | Permalink

    I am getting following error guyes.Solve it.
    “0″ (and any subsequent words) was ignored because we limit queries to 32 words.

  8. Posted August 15, 2009 at 10:16 AM | Permalink

    Nope this also won’t work now in FF.

  9. Amit
    Posted August 11, 2009 at 6:03 PM | Permalink

    This is the right script.

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

  10. abdul basith m
    Posted June 27, 2009 at 11:05 AM | Permalink

    script for text dance in web page?

  11. catherine ngosso
    Posted June 13, 2009 at 9:14 PM | Permalink

    that’s wonderfull

  12. prasad
    Posted June 12, 2009 at 11:59 AM | Permalink

    The below script works fine.

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

  13. Posted December 3, 2008 at 6:37 AM | Permalink

    Seems like neither of our codes work in Firefox now as of today mrning…

    Thaks for pointing out Mehrdad. But I still think I copy pasted it and it was fine?

  14. Mehrdad
    Posted December 3, 2008 at 1:17 AM | Permalink

    Has A lot Of Mistakes :

    Correct :

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

  15. Posted April 2, 2008 at 10:51 AM | Permalink

    Thanks Aaberg…

  16. Aaberg
    Posted April 1, 2008 at 3:43 PM | Permalink

    The javascript code doesn’t work. The error message is: “dil is undefined”. This is because javascript is case sensitive. Change “dil” in the for-loop to “DIL”, and the javascript code works beautifully!.

  17. Posted January 30, 2008 at 5:41 PM | Permalink

    The above code some times doesn’t work – it doesn’t make sense but try this one : the one on this page – remove the tags <b style=”color:black;background-color:#ffff66″> and </b> from the first line of the JavaScript given there

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>