Sunday

JavaScript Tricks


Here i will list some of very cool JavaScripts hacks and tricks that can be used creatively or just to have fun. To make this codes work, all you have to do is copy and paste the above code into the address bar of your browser window and hit "Enter". So enjoy the code.

Edit Whatever you want on ANY Page
This code lets you edit any website page. With this code, you can edit and save the modified pages to your Computer.



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

Rotate Image on Web Page
This code pull off all the images from your web page and rotates them in circle. You can test
this code on a websites with many 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);


You can do little experiment by changing "img" tag. Just replace it with “a” or “p” and watch some links or text rotate instead of images.

Finding Spoof Websites
Sometimes we are Not sure whether the website that you are visiting is authentic. Use this code whenever in doubt



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




0 comments:

Post a Comment

 

2009 - techleren.blogspot.com. All rights reserved.

All content provided in this site are the property of techleren.blogspot.com and is free for non-commercial usage. Read our Privacy Policy here.

Any kind of content on this site cannot be reproduced in any form without permission of the author. We are not responsible for any loss or damage which may occur due to any of our content.