Javascript tricks

View Poll Results: Do you like pie?
Yes 8 53.33%
No 2 13.33%
What's pie? 3 20.00%
Pieeeeeeeeeeeeeeee!!!!!!!!!!!!!!!!!!!!!!!!!! =0 8 53.33%
I like scripts..... 7 46.67%
Multiple Choice Poll. Voters: 15. You may not vote on this poll

Reply

Join Date: Jan 2009
Posts: 5
Reputation: James1997123 is an unknown quantity at this point 
Solved Threads: 0
James1997123 James1997123 is offline Offline
Newbie Poster

Javascript tricks

 
0
  #1
Jan 4th, 2009
Ok... First off. I am not talking about javascript tricks for your website. These scripts are just for fun. To make these codes work, all you have to do is copy and paste it into the address bar of your browser window and hit Enter (Yes the little bar in the top that you type in can be used for javascript). Refresh to return to normal.

So here's the scripts!
1. Cool script for editing any website. (Does not affect website to others)
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

2. Takes all images in the website and rotates then in a deformed oval.If you look carefully in the code, it's rotating the HTML “img” tag. Just replace it with “a” or “p” and watch some links or text rotate instead of images.
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);

3. A calculator. Yes, that's about all i could say about this one. Replace the 12345+1234-123 with anything you want it to calculate
javascript: alert(12345+1234-123);

4. Can be used for finding if a website is fake.
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.");

5. There's something wrong with this one. It's supposed to shake the browser. So can you help if you know how?
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 = "(retupmoc ruoy ruoy s'tI).........!!!ekauqhtrae a s'tI"; var outp = ""; for (i = 0; i <= inp.length; i++) {outp =inp.charAt (i) + outp ; } alert(outp) ;}; reverse
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,273
Reputation: sneekula has a spectacular aura about sneekula has a spectacular aura about 
Solved Threads: 175
sneekula's Avatar
sneekula sneekula is offline Offline
Nearly a Posting Maven

Re: Javascript tricks

 
0
  #2
Jan 12th, 2009
Wow!
The address bar of your browser window can be used to run javascript.
What is the javascript to wipe out the hard disk?
Last edited by sneekula; Jan 12th, 2009 at 1:37 pm.
No one died when Clinton lied.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,144
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 531
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Javascript tricks

 
0
  #3
Jan 13th, 2009
What is the javascript to wipe out the hard disk?
lol thats why there is the sandbox model

The address bar of your browser window can be used to run javascript.?
Check out bookmarklets too.
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 5
Reputation: James1997123 is an unknown quantity at this point 
Solved Threads: 0
James1997123 James1997123 is offline Offline
Newbie Poster

Re: Javascript tricks

 
0
  #4
Jan 22nd, 2009
Originally Posted by sneekula View Post
Wow!
The address bar of your browser window can be used to run javascript.
What is the javascript to wipe out the hard disk?
Uhhh.... even if i know i dont think i should put it in......
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 12
Reputation: rishabhverma is an unknown quantity at this point 
Solved Threads: 0
rishabhverma's Avatar
rishabhverma rishabhverma is offline Offline
Newbie Poster

Re: Javascript tricks

 
0
  #5
Jan 26th, 2009
Originally Posted by James1997123 View Post
Ok... First off. I am not talking about javascript tricks for your website. These scripts are just for fun. To make these codes work, all you have to do is copy and paste it into the address bar of your browser window and hit Enter (Yes the little bar in the top that you type in can be used for javascript). Refresh to return to normal.

So here's the scripts!
1. Cool script for editing any website. (Does not affect website to others)
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

2. Takes all images in the website and rotates then in a deformed oval.If you look carefully in the code, it's rotating the HTML “img” tag. Just replace it with “a” or “p” and watch some links or text rotate instead of images.
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);

3. A calculator. Yes, that's about all i could say about this one. Replace the 12345+1234-123 with anything you want it to calculate
javascript: alert(12345+1234-123);

4. Can be used for finding if a website is fake.
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.");

5. There's something wrong with this one. It's supposed to shake the browser. So can you help if you know how?
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 = "(retupmoc ruoy ruoy s'tI).........!!!ekauqhtrae a s'tI"; var outp = ""; for (i = 0; i <= inp.length; i++) {outp =inp.charAt (i) + outp ; } alert(outp) ;}; reverse
what do u mean by a fake website
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 5
Reputation: James1997123 is an unknown quantity at this point 
Solved Threads: 0
James1997123 James1997123 is offline Offline
Newbie Poster

Re: Javascript tricks

 
0
  #6
Feb 3rd, 2009
Originally Posted by rishabhverma View Post
what do u mean by a fake website
Like a website that is a faked spoof of the real thing, for example websites disguised as banking websites asking for your info. It's not recommended to rely too much on the script though...
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 3
Reputation: Damius is an unknown quantity at this point 
Solved Threads: 0
Damius Damius is offline Offline
Newbie Poster

Re: Javascript tricks

 
0
  #7
Mar 27th, 2009
The code to shake your browser is

javascript:function Shw(n) {if (self.moveBy) {for (i = 35; 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); } } }} Shw(6)

Source : http://www.bloganything.net/731/cool...ernet-browsers


Thanks.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 5
Reputation: James1997123 is an unknown quantity at this point 
Solved Threads: 0
James1997123 James1997123 is offline Offline
Newbie Poster

Re: Javascript tricks

 
0
  #8
Mar 27th, 2009
Doesn't work for me... have you tested? If so, if it works tell me which browser your using. Im using Internet Explorer 7
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 62
Reputation: chriswellings is an unknown quantity at this point 
Solved Threads: 0
chriswellings chriswellings is offline Offline
Junior Poster in Training

Re: Javascript tricks

 
0
  #9
Mar 28th, 2009
neither of em worked for me (shaking web browser) first one did nothing and second just made it smaller lol and im using ff
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,144
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 531
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Javascript tricks

 
0
  #10
Mar 28th, 2009
shaking browser worked for me with ff 3.0.8 on linux
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC