This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-10-30 17:50:28

PoDo
Scratcher
Registered: 2009-02-23
Posts: 500+

Cool JavaScript Codes

Code:

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

Code:

javascript:void(document.body.innerHTML = String(document.body.innerHTML).replace(/([^A-Za-z0-9&])[A-Za-z0-9]+(?![^<>]*>)/g, '$1'+prompt('Word?', 'meow')));

Code:

javascript:document.body.innerHTML="<div%20id='meep'%20style='text-align:center;%20font-size:48pt;%20visibility:visible;'>MEEP</div>";%20setInterval("document.getElementById('meep').style.visibility='hidden';",%201000);%20setTimeout("setInterval(\"document.getElementById('meep').style.visibility='visible';\",%201000);",%20500);%20void%200;

Code:

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

Code:

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

Disssscussss

Last edited by PoDo (2011-10-30 17:53:15)


http://i1214.photobucket.com/albums/cc498/Rubber_Dawg/Stop%20SOPA%20and%20PIPA/SOPAPIPA2.jpg

Offline

 

#2 2011-10-30 18:16:04

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Cool JavaScript Codes

Cool. None of them work except astroids.  hmm

Offline

 

#3 2011-10-30 18:17:23

PoDo
Scratcher
Registered: 2009-02-23
Posts: 500+

Re: Cool JavaScript Codes

They work on my computer. What browser are you using? How are you copying them?


http://i1214.photobucket.com/albums/cc498/Rubber_Dawg/Stop%20SOPA%20and%20PIPA/SOPAPIPA2.jpg

Offline

 

#4 2011-10-30 18:25:35

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Cool JavaScript Codes

PoDo wrote:

They work on my computer. What browser are you using? How are you copying them?

I just copy them from it using Ctrl+C and ctrl+v
Firefox.

Offline

 

#5 2011-10-30 18:49:41

PoDo
Scratcher
Registered: 2009-02-23
Posts: 500+

Re: Cool JavaScript Codes

I know. I meant do you triple click or do you drag to highlight.


http://i1214.photobucket.com/albums/cc498/Rubber_Dawg/Stop%20SOPA%20and%20PIPA/SOPAPIPA2.jpg

Offline

 

#6 2011-10-30 18:52:36

maxskywalker
Scratcher
Registered: 2008-01-27
Posts: 1000+

Re: Cool JavaScript Codes

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);
javascript:void(document.body.innerHTML = String(document.body.innerHTML).replace(/([^A-Za-z0-9&])[A-Za-z0-9]+(?![^<>]*>)/g, '$1'+prompt('Word?', 'meow')));
javascript:document.body.innerHTML="<div%20id='meep'%20style='text-align:center;%20font-size:48pt;%20visibility:visible;'>MEEP</div>";%20setInterval("document.getElementById('meep').style.visibility='hidden';",%201000);%20setTimeout("setInterval(\"document.getElementById('meep').style.visibility='visible';\",%201000);",%20500);%20void%200;
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
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);

Edit: Oh.  It doesn't work on Scratch.  :(

Last edited by maxskywalker (2011-10-30 18:53:16)

Offline

 

#7 2011-10-30 19:41:34

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Cool JavaScript Codes

PoDo wrote:

I know. I meant do you triple click or do you drag to highlight.

drag

Offline

 

Board footer