You probably spend more time in your cubicle than you do in your Barcalounger. Am I right? In any case I’m sure you and your team could use a few more laughs from time to time.

I called this “3 Awesome Office Pranks for Coders” but maybe a better title would have been “3 Awesome Office Pranks from Coders” because even if you aren’t a programmer, you can pull off these excellent office pranks.

What we have here are three snippets of Javascript code that you can paste into any of your coworkers’ browser address bars, hit return, step back and enjoy the antics. There is nothing like seeing your co-worker thinking his computer is crashing with some unheard of, deadly virus!

Tip: Try these out on your own computer first and in a variety of different browsers. Not all of these pranks will work in every instance. Also, tabbed browsing might cause some not to function.

1. Is this “The Big One”?
If you’re out on the West Coast, this one might make you think that the San Andreas Fault has finally cut loose. When the following code is pasted into a web browser the window will shake and shimmy all across the victim’s screen.

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

With this prank, timing is critical. You must have a good idea how long your victims will going to be away from their computers. Depending on the layout of your office cubicles, you may want to get one of your friends in on the prank to act as a spotter.

2. Dancing the Java Jive
The Jive was a popular swing dance back in the day. What we have here is not so much a Jive as a Conga line, but Java Conga didn’t have same ring to it. Sorry. This one works best when the browser of your victim is on a page with a lot of images. Paste this code into the address bar, hit return and those images will start snaking around the window like tipsy Cariocas dancing down the streets of Rio de Janero at the height of Carnival.

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

3. Your Name Here
This is a sly one. Paste this code into your victim’s browser and it essentially turns the webpage into an editable document. You can select any type on the page and change it to your heart’s content. How does your victim waste time at work? Checking Facebook? Scanning Match.com? Getting enraged at—or by—the latest article on The Huffington Post? In any of these cases, I’m sure you can find some creative ways to tweak the headlines to make your victim wonder what the heck has happened?

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

I thank Computer Pranks Central, NT Hacks and DotNetBlocks for pointing out these clever little bits of Javascript code. Check out those sites, you might come up with some more great ways to punk your coworkers. If you do, let me know.

You probably spend more time in your cubicle than you do in your Barcalounger. Am I right? In any case I’m sure you and your team could use a few more laughs from time to time.

 

I called this “3 Awesome Office Pranks for Coders” but maybe a better title would have been “3 Awesome Office Pranks from Coders” because even if you aren’t a programmer, you can pull off these excellent office pranks.

 

What we have here are three snippets of Javascript code that you can paste into any of your coworkers’ browser address bars, hit return, step back and enjoy the antics.

 

Tip: Try these out on your own computer first and in a variety of different browsers. Not all of these pranks will work in every instance. Also, tabbed browsing might cause some not to function .

1. Is this “The Big One”?

If you’re out on the West Coast, this one might make you think that the San Andreas Fault has finally cut loose. When the following code is pasted into a web browser the window will shake and shimmy all across the victim’s screen.

 

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

 

With this prank, timing is critical. You must have a good idea how long your victims will going to be away from their computers. Depending on the layout of your office cubicles, you may want to get one of your friends in on the prank to act as a spotter.

 

2. Dancing the Java Jive.

The Jive was a popular swing dance back in the day. What we have here is not so much a Jive as a Conga line, but Java Conga didn’t have same ring to it. Sorry. This one works best when the browser of your victim is on a page with a lot of images. Paste this code into the address bar, hit return and those images will start snaking around the window like tipsy Cariocas dancing down the streets of Rio de Janero at the height of Carnival.

 

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

 

3. Your Name Here.

This is a sly one. Paste this code into your victim’s browser and it essentially turns the webpage into an editable document. You can select any type on the page and change it to your heart’s content. How does your victim waste time at work? Checking Facebook? Scanning Match.com? Getting enraged at—or by—the latest article on The Huffington Post? In any of these cases, I’m sure you can find some creative ways to tweak the headlines to make your victim wonder what the heck has happened?

 

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

 

I thank Computer Pranks Central, NT Hacks and DotNetBlocks for pointing out these clever little bits of Javascript code. Check out those sites, you might come up with some more great ways to punk your coworkers. If you do, let me know.

David Ching is a marketing strategist for EQAOfficeFurniture.com, a retailer of office cubicles, desk chairs, conference table, work stations, receptionist desks and more.