AJAX Kill Switch

A Little Fun Perhaps?

The kill switch idea is very basic. The really interesting part is what you do with it.

We have the power to do anything that is normally possible with local JavaScript. With this in mind, the potential options are virtually endless.

Visual Mods

You could…

  • Turn the page upside down with CSS rotate.
  • Change background colours, hide things or move them around with CSS.
  • Implement a whole new style. Only likely to be viable if you are using a templated system or have a lot of free time!
  • Play around with something as advanced as a page element gravity effect.

Being a Nuisance

You could…

  • Supply the phone number for client's support department along with an incentive to call.
  • Translate the page text, or simply rot-13 it. A l33t translator could be amusing.
  • Introduce delayed, funny alert/modal box errors.
  • Redirect to another site. Quite interesting if that site is one of yours and has some form of analytics. Even better, redirect to another site with AdSense or a similar advertising service installed. The irony here is inescapable.
  • Reprogram links to redirect elsewhere.
  • There is the potential to make subtle changes that don't immediately advertise the kill switch. You could generally cause issues and change content as you see fit.
  • Have fun with audio via a JavaScript enabled audio player.

Subterfuge

The overall idea here is to control who witnesses the effect of the kill switch.

Usually, the approach I use is to find some way of identifying the client visiting the website.

Eventually someone will let them know that their site is misbehaving. If they cannot reproduce the problem on their own machines they are going to have a much harder time realising what is going on!

There are a few ways of accomplishing this.

  • Use apache .htaccess directives to only supply JavaScript to a chosen IP address range.
  • IE/browser targeting if you know which browser the client favours.
  • Activate the kill switch according to the time of day. This could ensure a day of support calls without them being able to reproduce the problem.
  • Activate the kill switch according to a random number generation procedure. Again, difficult to consistently reproduce the issue.
  • Geolocation (available in newer browsers). Prevent the client in question from reproducing the issue at all by not taking action anywhere in their geographical region.

I'm sure you can think of a few more. Have fun!

Follow the author on Twitter.

Previous Articles

Targeting Windows 8 Snap Mode. Read more.

CSS @viewport rule or viewport meta tag? Read more.

The Responsive Viewport. Missing piece of the responsive web design puzzle? Read more.

Getting the Viewport Scale.
Read more.

Hiding the iPhone Address Bar.
Read more.

Orientation Correct Screen Width.
Read more.

iPhone Title Modification.
Read more.

Optimising for High Pixel Density Displays.
Read more.

CSS3 Media Query Prototyping With ProtoFluid.
Read more.

AJAX Kill Switch. Version 2.
Read more.

URI Processing With JavaScript.
Read more.