FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Awesome javascript tricks!





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 web-address bar and press enter, it deletes everything on the page a replaces it with what 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 will 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 Worlds :: Forums.
Next.

Code:
javascript: alert('message here');

Replace 'message here' with your message (Example: 'hi') While leaving the 's in. This will make a pop-up message saying your message.
Next.

Code:
javascript: back();

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...
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 with 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 will be lost. To continue with shutdown, 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 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 Wink
riccopt
those are some really interesting codes... thanks for sharing!!
rockacola
There is the javascript I use to check when a static page was last modified:

Code:
javascript:document.write(document.lastModified);


Handy, too Wink
kacsababa
rockacola wrote:
Code:
javascript:document.write(document.lastModified);

Just as you said, a handy one. And so simple, but never thought of it. Smile
michaeljscott93
Thanks for sharing!!! Very Happy
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 wow, that flying image one is going to entertain me for hours! lol, thanks for sharing bro.
[FuN]goku
Heh, these are old, but rather amusing if you're bored Razz
morfeusman
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 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 down?

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:
javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0


nice one Wink


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 web page from another domain. That way the programmer could copy data from the target page to his or her own page, etc. One possible, but unverified way to do so would be to use the window.open method. Consider the following 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 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.
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 Wink


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 web page from another domain. That way the programmer could copy data from the target page to his or her own page, etc. One possible, but unverified way to do so would be to use the window.open method. Consider the following 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 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.


it wont work. cross domain scripting won't work
chatrack
Thanks for these ideas with javascript
halilibo
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 will be so useful, if you surf to find any design tips. You can rearrange any page while you view it.

And see how it looks Very Happy .

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 will be so useful, if you surf to find any design tips. You can rearrange any page while you view it.

And see how it looks Very Happy .

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. Smile)
xmen25
pleasse with dis code javascript: document.body.contentEditable ='true'; document.designMode='on'; void



wen 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 wanna edit


http://mobteam.muf.mobi


reply needed
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 Wink


put javascript: at the beginning and then it will 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 web page from another domain. That way the programmer could copy data from the target page to his or her own page, etc. One possible, but unverified way to do so would be to use the window.open method. Consider the following 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 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.


put JavaScript at the beginning and then it will 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 work, the next version of each browser would probably fix it. Cross domain scripting is specifically not allowed. Imagine if open a new website, it was able to use its scripts to access your banking site that was 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.
chatrack
Hi,
The last one is amazing. Can we modify the script to execute this script on any other url with 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 wider 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 website Smile

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 down?

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, when 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


Code:
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 Wink
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)
tifvotk
On the Javascript javascript:document.body.contentEditable ='true'; document.designMode='on'; void 0
which allows you to change anything on page. Is it supposed to keep the changes when you return to the page? After I left the web page it went back to original state
jcreus
tifvotk wrote:
On the Javascript javascript:document.body.contentEditable ='true'; document.designMode='on'; void 0
which allows you to change anything on page. Is it supposed to keep the changes when you return to the page? After I left the web page it went back to original state

No, it won't keep the changes. In fact, this is just editing on the client side. No changes are sent back on the server, so the original page keeps the same. Plus, it's just modifying the DOM as you would do with a bookmarklet (i.e.: javascript:document.getElementById("blah").style.display="none";) If you want the changes to take effect, you could do all the changes, and then do a kind of document.getElementsByTagName("html")[0].innerHTML and save it to a file. Kind of WYSIWYG editor, I suppose.
chatrack
kacsababa wrote:
rockacola wrote:
Code:
javascript:document.write(document.lastModified);

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


Yes, this one look pretty good in its application
amagard
I like this one:
Arightwizard wrote:
...
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);



Nevertheless, it doesn't seem to work with my Firefox 8 browser, but does work with IE 8 and Chrome.

May be Firefox is too secure to let something like this run, even some smart study recently discovered that Chrome actually is the safest browser.

Best regards ... Axel
dragonx97
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 Wink



theyre awesome and a great way to pass time wen ur bored here is one that i made

javascript: confirm('internet explorer is not responding needs to close and reboot your personal document memory will be erased in the process');false;confirm('are you sure');true;alert('only joking lololol')
nepalstar
Dear Friends,
I saw in so many website preventing Right Click and preventing Copy the contents. How to prevent right click to prevent copy contents...? is there any simple java script for this. if anybody knows this please share here...!
biocross
Arightwizard wrote:
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 web-address bar and press enter, it deletes everything on the page a replaces it with what 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 will 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 Worlds :: Forums.
Next.

Code:
javascript: alert('message here');

Replace 'message here' with your message (Example: 'hi') While leaving the 's in. This will make a pop-up message saying your message.
Next.

Code:
javascript: back();

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...


These are amazing! thanks! Very Happy
sensui
This is great, thank you for sharing. Smile
manfer
amagard wrote:
I like this one:
Arightwizard wrote:
...
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);



Nevertheless, it doesn't seem to work with my Firefox 8 browser, but does work with IE 8 and Chrome.

May be Firefox is too secure to let something like this run, even some smart study recently discovered that Chrome actually is the safest browser.

Best regards ... Axel


There isn't any security problem on running those code snippets on your own browser. You can run any javascript code on any website you want. So not firefox, nor chrome, nor IE would be a more secure browser for not allowing to run those code snippets.

The problem with a specific version of firefox can be whatever minor problem on code that makes the javascript wrong for firefox 8. Other reasons could be if javascript is turned off on the browser or if you were using the noscript plugin (though I'm not sure if noscript plugin blocks the execution of javascript runned from code written directly on browser by user).

--------------------------------------

What I would add is that it is long ago that all browsers have a javascript console to run any javascript code. In fact is quite absurd to run those codes on the address bar when we have the javascript console available unless we want to add one of those snippets to favorites.
Bluedoll
Thanks for posting these if I run across any interesting ones I add later. Didn't know you could try out scripts in the address bar. It sure speads up testing them. Great idea!
iepic24
example the document.designMode='on'; void 0 is awsome and all but im not into that and yeah so please make it better and add a better code and
Code:
 javascript: document.body.contentEditable ='true'; document.designMode='on'; void 0
neiesc
Thank you, this is super helpful!
codersfriend
Code:
javascript: back();


Kinda reminds me of history.js. I like sites using html pushstate. Makes your site a little more extra dynamic Wink
inick13
I like the

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


one


and the
Code:
javascript: alert(virus virus virus');
Smile Smile Smile Smile
BitLighting
I've tried out some of your codes and I find them really epic.


I made something to help you out entering your codes.

IE only
Hit F12 on your keyboard OR right-click, then Inspect Element, then find the menu that says console. Take this code, paste it in the box and click the run button:
Code:
var allscript = document.createElement('script'); allscript.setAttribute('src', 'http://jsbin.com/bogilo.js'); document.head.appendChild(allscript); var allscript = document.createElement('script'); allscript.setAttribute('src', 'http://jsbin.com/hinev.js'); document.head.appendChild(allscript);


Chrome and Others
Copy and paste this code in the address bar:
Code:
javascript: var allscript = document.createElement('script'); allscript.setAttribute('src', 'http://jsbin.com/bogilo.js'); document.head.appendChild(allscript); var allscript = document.createElement('script'); allscript.setAttribute('src', 'http://jsbin.com/hinev.js'); document.head.appendChild(allscript);



Or you can add it as a bookmark


One other small note. When you insert your/others javascript: codes note the following things
    - Delete the javascript: at the beginning

    - Delete anything that says void(0) or void 0


I will also be adding any scripts (on this page) that would interest me or others. If you would like your script to be added to the list PM me and I might add it.

I created the code myself. The link to the site I put it on is HERE
Peterssidan
BitLighting wrote:
Hit F12 on your keyboard, then find the menu that says console.

What browser? When I hit F12 nothing happens.
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.