Thursday 8 May 2008

Cool Javascript trick...

This is a trick that ANYONE can do. Copy and paste the following text into your browser's address bar and hit enter.

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

Notice anything different? Probably not. You're still here at NAFTAline. But wait! Click the picture of the monkeys...now press the delete key. WOW! Now double-click in some text and start typing...WHOA!!!

Don't worry. You're not permanently changing anything on the web, it only affects what you see on your own computer. Click your browser's refresh icon and everything goes back to normal.

The most obvious use of this script that I can think of is to get rid of annoying ads on any page that you are viewing. There is nothing more tacky and distracting than those ads with bright flashing text that tell you to swat the fly to win a free iPod Nano or something. (By the way, I've killed that fly a hundred times and still don't have an iPod.) You're just trying to read an article about gardening and the ad on the page is threatening to send you into epileptic shock. So just paste the javascript into the browser address bar and delete the ad.

Another way I've used the script is to go to a reputable news website and mess with the headlines. Then I watch the fun as coworkers walk past my desk and stop in their tracks to see the latest from foxnews.com and drudgereport.com. What!!? Hilary names Al Franken as running mate? What!!? Medical studies prove that a diet of beer and gummy worms can cure cancer? What!!? O.J. wins $142 million dollar lottery jackpot?

Also, so you don't have to keep copying and pasting the script, you can add it to your browser's "Favorites" list. Save a dummy page (yahoo.com for instance) to your favorites. Then rename it to something you'll remember (I use "Javascript Page Editor"). Finally, change the URL in "Favorites", replacing it with the javascript. The way you do this varies depending on what browser you use.

Enjoy!

No comments: