Opticraft Community

Discussion forum => Offtopic => Topic started by: Spartan on May 01, 2011, 08:36:15 am

Title: Awesome JS Tricks
Post by: Spartan on May 01, 2011, 08:36:15 am
Everyone, just keep posting a bunch of JS tricks.


You can edit any website with this!
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

What you do:

Step 1 : Go to a website
Step 2 : Copy the javascript line above into the address bar and click enter
Step 3 : Edit anything you want!

*This does not save to ANY website.*
Title: Re: Awesome JS Trick
Post by: matt88222 on May 01, 2011, 08:49:00 am
More JS Fun!! :

Copy and paste this into the address bar on any website:

javascript:var%20s%20=%20document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0);

Controls: Arrow Keys to move, space bar to shoot.
Title: Re: Awesome JS Trick
Post by: Tobs on May 01, 2011, 08:56:39 am
lol I've not  seen that one matt. Now I'll just be destryoing everywebsite I visit :D
Title: Re: Awesome JS Trick
Post by: Spartan on May 01, 2011, 08:58:19 am
Hahaha fun!

Check out this one!

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);
Title: Re: Awesome JS Tricks
Post by: Spartan on May 01, 2011, 09:00:54 am
Heres another:

It makes all the pictures dance haha

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);
Title: Re: Awesome JS Tricks
Post by: matt88222 on May 01, 2011, 09:07:13 am
What was that tobs? I couldn't hear you because I DESTROYED YOUR POST! (Pew Pew Pew) >:)
Haha, but yeah I've wasted a bunch of time destroying websites with that one lol

Those ones that make the images dance are cool, I have to find a good website to use it on though lol
Title: Re: Awesome JS Tricks
Post by: Spartan on May 01, 2011, 09:09:03 am
One with lots of pictures :D
Title: Re: Awesome JS Trick
Post by: turtleman918 on May 01, 2011, 01:33:58 pm
More JS Fun!! :

Copy and paste this into the address bar on any website:

javascript:var%20s%20=%20document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0);

Controls: Arrow Keys to move, space bar to shoot.

if you copy and paste this one into the url multiple times, it spawns multiple ships :D
turns out you can also combine a few of these
Title: Re: Awesome JS Tricks
Post by: turtleman918 on May 01, 2011, 02:01:26 pm
Heres another:

It makes all the pictures dance haha

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);
slightly edit this one to get the entire website to dance, change "img" to "*"
like so:

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);
Title: Re: Awesome JS Tricks
Post by: Bahraindude_2497 on May 01, 2011, 02:14:22 pm
i dont get it... what is js tricks and what do you do??
Title: Re: Awesome JS Tricks
Post by: turtleman918 on May 01, 2011, 02:19:08 pm
i dont get it... what is js tricks and what do you do??
with these all you need to do is copy and paste the codes into any website URL
Title: Re: Awesome JS Tricks
Post by: turtleman918 on May 01, 2011, 02:23:08 pm
This one makes the entire page rotate around, its kinda weird actually.


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.all; 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);
Title: Re: Awesome JS Tricks
Post by: Bahraindude_2497 on May 01, 2011, 02:24:53 pm
Ok just tried it out...its really cool