There comes a day in every work environment when it’s, well, payback time. Maybe the day has arrived to get back at the guy who stole the wheels off your office chair, or even the score with the woman who burns popcorn every afternoon in the microwave. Or, maybe everyone just needs a good laugh.
You, with your vast computer know-how and the Javascript snippets presented here, are just the person to “get ‘er done!”
You don’t need to be a programmer to pull these off. Experiment with them in your own browser in the privacy of your own office cubicle to see how they work. When the time comes to stage your office prank you might need a wing man, but there’s a good chance you can fly solo and under the radar.
Note that they may not work in every browser, so make sure you’ve taken enough successful test runs to be sure your pranks will come off without a hitch. Paste each of these blocks of code into the browser address bar and hit return. Then stand back and watch the hilarity.
1. Java Jive.
Jive is one of those crazy dances that have couples bouncing all around the dance floor. You can pretty much accomplish the same thing with this block of code. Watch for a coworker to leave his or her cubicle. You’ll need to have some idea how long your victim, I mean coworker, will be away from the targeted computer. Paste this code into the browser:
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)-accident
Timing is everything here and to make your coworker’s window dance around the desktop for longer, change “35″ to a larger value. If you want the dance to last for a minute, make the value 600. Also, this might not work in tabbed browser windows.
2. 15 Minutes of Flame, I mean Fame.
With this Javascript you can make any webpage editable. Imagine that the person in the next cubicle spends half the day scanning the Huffington Post or the Drudge Report. At the right moment, you can paste this code into the target browser and then edit any text on the page. Put your friend’s name up in lights, or at least into some embarrassing webpage headlines.
javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 0
Of course, you can also do this in your browser, immortalize yourself, take a screen shot of the page and then pass it around to all your friends to prove how famous you are.
Your choice.
3. Motion Pictures.
Static jpegs can be beautiful but they’re often boring. That’s why advertisers are using movies so often now. But, how about getting the best of both worlds and make those static jpegs on a webpage do the conga line? With this Javascript code you can turn your victim’s browser window into an undulating ocean 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);
These three office pranks should earn you a little cubicle cred. You’ll find more weapons for your practical joke arsenal at NT Hacks, Computer Pranks Central and DotNetBlocks. And, don’t forget to share your triumphs with us. We can all use a good laugh.

