My javascript money. My javascript mouth.
21 August 2005



I suppose it's inenvitable - you blog about your love of JavaScript, and then you start wistfully thinking of all the "good old days" you had. Most of the code I once wrote had since been retired by Firefox plugins that do the same, or a very similar job. Or someone else has released the same idea, consigning mine the "bandwagon" folder. And if it's one thing I hate more than someone chastizing my development, it's someone doing so to highlight another technology that came after mine and still failing to notice my original work.

Here then is ComCo, some code that's still sat on my toolbar folder. ComCo scans the current URL and replaces the .com part of the address with .co.uk. Or vice-versa. I wrote it because I was continually checking the sales rank of my book under both Amazon.com and Amazon.co.uk. The book's been out a while now, and sales are dropping, so I don't bother keeping such a keen eye on the figures. That's not to say it isn't useful anymore. It's just a case of geek bragging rights. Open this page and then click and drag the link into your toolbar, or add it your bookmarks, you can use it as I have done. Just
click on it whenever you want to switch between sites.

The code is quite simple, and so released under the GPL and BSD licenses; whichever you prefer.
Perhaps some other author will find it similarly useful...

Note: this trick only works because Amazon URLs (after the domain name) are identical between sites, and even then not all pages will work.