Você está na página 1de 9

5/27/2011

Awesome javascript tricks!

FRIHOST FORUMS SEARCH FAQ TOS DIRECTORY BLOGS COMPETITIONS


You are invited to Log in or Register a F rihost Account!

Awesome javascript tricks!


Frihost Forum Index -> Scripting -> Html, CSS and Javascript

Mature Ajax RIA www.SmartClient.com Chosen by top software vendors. View 200+ examples & full docs Create Website Templates www.HostGator.com Free Site Builder, Templates & 3rd Party Scripts. View Details Here! Questions & Solutions www.MeritNation.com/Questions Math, Phy, Chem, Bio, English, SST Lessons, Animations, Videos, Puzzle ACCUFAST InkJet Printers www.accufastaddressing. Amazing inkjet address and bar code printers, ink, curing systems, more

Online Coding & Billing www.codeitrightonline.com CodeItRightOnline is your one-stop online shop for coding and billing! For All Web Masters www.Google.co.in Make Online Advertising Consultancy Part Of Your Offering With Google! Create a Free Slideshow tripwow.tripadvisor.com/slid Create free animated slideshows from your travel photos in minutes! Fonts.com Web Fonts WebFonts.Fonts.com CSS @Font-Face Fonts - Free Trial - Easy Set Up

Arightwizard

Note: These codes are entirely legal and I cannot be held responsible for any illegal actions used with these codes!
Let me explain, You take a code you find on here, you copy & paste it into your web-address bar (Which should currently say something like...http://frihost.com/forums/) Press enter, and it "preforms" a trick! If you like these codes, please post containing some of your javascript codes. If there is a space between java and script, please remove the space. What I have so far:
Code: javascript: contentBodyEditable="true".DesginMode="message"

Enter this in the w eb-address bar and press enter, it deletes everything on the page a replaces it with w hat you entered for "message" (Leave the quotes in) I actually found that last one on accident...While trying to remember this one:
Code: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

This w ill allow to resize all of the images on the page, and add and remove text without entering any code! - All credits of the finding of this code to GreenDiamond W orlds :: Forums. Next.
Code: javascript: alert('message here');

Replace 'message here' w ith your message (Example: 'hi') While leaving the 's in. This w ill make a pop-up message saying your message.

www.frihost.com/forums/vt-95057.html

Next.

1/9

5/27/2011

Next.
Code: javascript: back();

Awesome javascript tricks!

OR
Code: javascript: forward();

These take you forward or back one page. Next. Ok this is a long one, so just copy & paste, NO EDITING:
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);

Use this one to make all the pictures on the page fly around the screen! (Works on any page) More coming soon!...I think... Ads by Google Body Document Body to Body Massage JavaScript Codes

DanielXP
Hi I like the
Code: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

one

And I can't see why there not legal as it is client side, you can't edit someones site w ith these sorta things.

triniDj27
Nice, real nice.

Thank you for sharing. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

oliveiraw
Very good sharing, i already using. Thanks!

jovz0597
hey thanks for sharing man, your codes are cool. i like the floating images. but can u at least post more complex codes something like accordion thing hehehe. just kidding jsut wanted to increase my points hehe

Mainameismelanu
My friend made this: javascript: alert('Alert. Your computer is overgoing a dormant state. All the CPU memory above 72 megabytes w ill

www.frihost.com/forums/vt-95057.html

be lost. To continue w ith shutdow n, press OK, or press close to cancel and lose your memory.');

2/9

5/27/2011

Awesome javascript tricks!


be lost. To continue w ith shutdow n, press OK, or press close to cancel and lose your memory.');

Marcuzzo
you can pretty much execute any code like that. you can call functions from any page, add code to the page and execute that, add, modify variables, ect. bookmarklets w ork in the same way. check out this one http://googlesystem.blogspot.com/2008/04/download-youtube-videos-as-mp4-files.html somebody even made a bookmarklet maker, you can write code in the textfield and the link gets updated w ith your code. add it you your favorites and run it... link: http://userjs.up.seesaa.net/js/bookmarklet.html but I didn't know about:
Code: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

nice one

riccopt
those are some really interesting codes... thanks for sharing!!

rockacola
There is the javascript I use to check when a static page w as last modified:
Code: javascript:document.write(document.lastModified);

Handy, too

kacsababa
rockacola wrote: Code: javascript:document.write(document.lastModified);

Just as you said, a handy one. And so simple, but never thought of it.

michaeljscott93
Thanks for sharing!!!

Ghost Rider103
Pretty cool stuff. I liked the last one the most where all the images fly around the screen. That was pretty cool. Nice post, I'd like to see some more of these.

Aredon
oh w ow , that flying image one is going to entertain me for hours! lol, thanks for sharing bro.

www.frihost.com/forums/vt-95057.html

3/9

5/27/2011

Awesome javascript tricks!

[FuN]goku
Heh, these are old, but rather amusing if you're bored

morfeusman
thanks! those are some great scripts. but, is there any w ay to make the:
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);

slow down? also, i made this:


Code: javascript: confirm('your computer can been infected by a deadly virus, you need more virtual memory. press yes to continue this procces'); alert('continuing anyway');

Chinmoy
the image thingy is pretty old. it has a bug too. If you refresh the page, the image fly speed increases each time you refresh. at one point of time, your browser starts crashing. Nice way to test javascript handling capabilities of browsers though..

Agent ME
morfeusman wrote: thanks! those are some great scripts. but, is there any way to make the: 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);

slow dow n? Near the end, where it says "setInterval('A()',5);", change the 5 to a higher number to slow it down.

Gael_Knightley
Marcuzzo wrote: you can pretty much execute any code like that. you can call functions from any page, add code to the page and execute that, add, modify variables, ect. bookmarklets work in the same way. check out this one http://googlesystem.blogspot.com/2008/04/download-youtube-videos-as-mp4-files.html somebody even made a bookmarklet maker, you can write code in the textfield and the link gets updated with your code. add it you your favorites and run it... link: http://userjs.up.seesaa.net/js/bookmarklet.html but I didn't know about: Code:

www.frihost.com/forums/vt-95057.html

4/9

5/27/2011

Awesome javascript tricks!


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

nice one

They are bookmarklets; however, considering the fact that it's the clients monopoly to use them in that way, it's no great breakthrough for programmers. What w ould really be interesting is if a programmer could add a bookmarklet to a w eb page from another domain. That w ay the programmer could copy data from the target page to his or her own page, etc. One possible, but unverified way to do so w ould be to use the w indow .open method. Consider the follow ing code:
Code: var homepage=window.open("http://www.randomdomainname.com/"); homepage.location.href="javascript:alert('This page was opened by Frihost!');void(0);";

I don't really expect this code to w ork considering the security limitations of javascript, but I haven't tried it out yet. How ever, if you do find a way to implement the above idea, please contact me.

Marcuzzo
Gael_Knightley wrote: Marcuzzo wrote: you can pretty much execute any code like that. you can call functions from any page, add code to the page and execute that, add, modify variables, ect. bookmarklets work in the same way. check out this one http://googlesystem.blogspot.com/2008/04/download-youtube-videos-as-mp4-files.html somebody even made a bookmarklet maker, you can write code in the textfield and the link gets updated with your code. add it you your favorites and run it... link: http://userjs.up.seesaa.net/js/bookmarklet.html but I didn't know about: Code: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

nice one

They are bookmarklets; however, considering the fact that it's the clients monopoly to use them in that way, it's no great breakthrough for programmers. What would really be interesting is if a programmer could add a bookmarklet to a w eb page from another domain. That w ay the programmer could copy data from the target page to his or her own page, etc. One possible, but unverified w ay to do so would be to use the window.open method. Consider the follow ing code:
Code: var homepage=window.open("http://www.randomdomainname.com/"); homepage.location.href="javascript:alert('This page was opened by Frihost!');void(0);";

I don't really expect this code to w ork considering the security limitations of javascript, but I haven't tried it out yet. How ever, if you do find a way to implement the above idea, please contact me.

www.frihost.com/forums/vt-95057.html

5/9

5/27/2011

Awesome javascript tricks!


it wont w ork. cross domain scripting w on't w ork

chatrack
Thanks for these ideas with javascript

halilibo
these are great tricks, but i dont know w hether these work on IE.
Quote: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

And that one w ill be so useful, if you surf to find any design tips. You can rearrange any page w hile you view it. And see how it looks Nice tricks. Thanks. .

Marcuzzo
halilibo wrote: these are great tricks, but i dont know whether these work on IE. Quote: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

And that one w ill be so useful, if you surf to find any design tips. You can rearrange any page w hile you view it. And see how it looks Nice tricks. Thanks. .

ofcourse it does

guissmo
This is very interesting. I can use
Code: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

all day.

xmen25
pleasse with dis code javascript: document.body.contentEditable ='true'; document.designMode='on'; void

w en i edited a site haw do i save it and make it be on the homepage of the site guys help a broda in here

heres the site i w anna edit

http://mobteam.muf.mobi

www.frihost.com/forums/vt-95057.html

6/9

5/27/2011
reply needed

Awesome javascript tricks!

topcat01
Gael_Knightley wrote: Marcuzzo wrote: you can pretty much execute any code like that. you can call functions from any page, add code to the page and execute that, add, modify variables, ect. bookmarklets work in the same way. check out this one http://googlesystem.blogspot.com/2008/04/download-youtube-videos-as-mp4-files.html somebody even made a bookmarklet maker, you can write code in the textfield and the link gets updated with your code. add it you your favorites and run it... link: http://userjs.up.seesaa.net/js/bookmarklet.html but I didn't know about: Code: javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0

nice one

put javascript: at the beginning and then it w ill work They are bookmarklets; however, considering the fact that it's the clients monopoly to use them in that way, it's no great breakthrough for programmers. What would really be interesting is if a programmer could add a bookmarklet to a w eb page from another domain. That w ay the programmer could copy data from the target page to his or her own page, etc. One possible, but unverified w ay to do so would be to use the window.open method. Consider the follow ing code:
Code: var homepage=window.open("http://www.randomdomainname.com/"); homepage.location.href="javascript:alert('This page was opened by Frihost!');void(0);";

I don't really expect this code to w ork considering the security limitations of javascript, but I haven't tried it out yet. How ever, if you do find a way to implement the above idea, please contact me.

put JavaScript at the beginning and then it w ill work.

Agent ME
Gael_Knightley wrote: What would really be interesting is if a programmer could add a bookmarklet to a web page from another domain. That way the programmer could copy data from the target page to his or her own page, etc... I don't really expect this code to work considering the security limitations of javascript, but I haven't tried it out yet. However, if you do find a way to implement the above idea, please contact me.

Even if you found some way to trick it to w ork, the next version of each browser would probably fix it. Cross domain scripting is specifically not allow ed. Imagine if open a new w ebsite, it w as able to use its scripts to access your banking site that w as in another tab?

Also, was the big disclaimer at the start of this page really necessary? None of these scripts could possibly do anything illegal.

www.frihost.com/forums/vt-95057.html

7/9

5/27/2011

Awesome javascript tricks!

chatrack
Hi, The last one is amazing. Can we modify the script to execute this script on any other url w ith a click on a link in our site?

Fire Boar
By the way, there's a bug in the last one. The for loop doesn't terminate correctly.

Code: javascript: R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=600; y4=400; x5=600; y5=400; 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);

That one works better on w ider screens I think, but you can modify the x4, y4, x5 and y5 parameters until you get something that you like the look of.

Jamestf347
I like some of these, i might actually use them in my w ebsite Thanks in advance

tamilparks
ya very good tip thanks for sharing

gdn17
Agent ME wrote: morfeusman wrote: thanks! those are some great scripts. but, is there any way to make the: 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);

slow dow n? Near the end, where it says "setInterval('A()',5);", change the 5 to a higher number to slow it down.

I'm thinking about modding this script to be more "manageable" for users, w hen I do it, if I manage to do, i'll post it here

bulevardi
gdn17 wrote: I'm thinking about modding this script to be more "manageable" for users, when I do it, if I manage to do, i'll post it here

www.frihost.com/forums/vt-95057.html

8/9

5/27/2011
Code:

Awesome javascript tricks!

function theFunction() { var r = 0; var x1 = 0.1; var y1 = 0.05; var x2 = 0.25; var y2 = 0.24; var x3 = 1.6; var y3 = 0.24; var x4 = 300; var y4 = 200; var x5 = 300; var y5 = 200; var theElem = document.getElementsByTagName("img"); function aaa(){ for(i=0; i<theElem.length; i++){ elemStyle = theElem[i].style; elemStyle.position = "absolute"; elemStyle.left = Math.sin(r*x1+i*x2+x3)*x4+x5+"px"; elemStyle.top = Math.cos(r*y1+i*y2+y3 )*y4+y5+"px"; } r++; } setInterval(aaa,50); }

or in adresbar mode:
Code: javascript: var r = 0; var x1 = 0.1; var y1 = 0.05; var x2 = 0.25; var y2 = 0.24; var x3 = 1.6; var y3 = 0.24; var x4 = 300; var y4 = 200; var x5 = 300; var y5 = 200; var theElem = document.getElementsByTagName("img"); function aaa(){ for(i=0; i<theElem.length; i++){ elemStyle = theElem[i].style; elemStyle.position = "absolute"; elemStyle.left = Math.sin(r*x1+i*x2+x3)*x4+x5+"px"; elemStyle.top = Math.cos(r*y1+i*y2+y3 )*y4+y5+"px"; } r++; } setInterval(aaa,50); void(0)

Here you go

k_s_baskar
Cool scripts. thanks for sharing.

bulevardi
this one gets even more annoying if you do it with DIV instead of IMG:
Code: javascript: var r = 0; var x1 = 0.1; var y1 = 0.05; var x2 = 0.25; var y2 = 0.24; var x3 = 1.6; var y3 = 0.24; var x4 = 300; var y4 = 200; var x5 = 300; var y5 = 200; var theElem = document.getElementsByTagName("div"); function aaa(){ for(i=0; i<theElem.length; i++){ elemStyle = theElem[i].style; elemStyle.position = "absolute"; elemStyle.left = Math.sin(r*x1+i*x2+x3)*x4+x5+"px"; elemStyle.top = Math.cos(r*y1+i*y2+y3 )*y4+y5+"px"; } r++; } setInterval(aaa,50); void(0)

Related topics
Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | C ONTAC T US | SITE MAP 2005-2010 Frihost, forums powered by phpBB.

www.frihost.com/forums/vt-95057.html

9/9

Você também pode gostar