It's not all fun and games in web development. Sometimes, clients request odd things, such as redirecting the domain name for a defunct Japanese site of theirs to another Japanese website. We were given the URL to redirect to; upon clicking through to the site, we discovered that it was an equally dated site; not only are some of the links broken on certain pages, but there's an animated GIF of a kiwi in the corner of the site.
One of my colleagues pointed out that it looked as if the kiwi was moonwalking on the spot. This gave me an idea to liven up the site - make the kiwi actually moonwalk across the page header.
Of course, not being one of our sites, we don't have access to the files, so I can't make it permanently happen. What I can do, though, is use a javascript: address in the address bar to play around with the page once it's loaded.622B 577B 477B 494B of JavaScript later, I have a moonwalking kiwi:
two three crossed-out sizes; I decided to do a bit of optimisation and refactoring, bringing it down to 577B, then thought that while I was at it, I may as well tackle the IE issue. This is where I discovered something odd:
Internet Explorer 6 will only allow 501 characters in the address bar before it fails. It fails silently if you exceed this limit. As a result of this, I started shrinking the code as much as possible, which involved a bit of code golf with a few guys in an IRC channel - we decided to call this "JavaScript Hack Minigolf." The end result was a lean 477 characters. I also worked out what was happening in Opera - the version I've got installed (9.02) appears to, at least by default on Windows, stop the script running after a set period and return things to their initial status. It's apparently fine in 9.24 on Linux, though. I've now discovered that IE wasn't aligning the inserted div properly, and the fix has now brought it back up to 494 characters - thankfully still within IE6's limit. I've also found that IE7 doesn't have the 501-character limit (I haven't checked if there's a higher limit or no limit).
Thanks to Arachnid for playing a round of JSH Minigolf with me, and to Pic, silentcoder, langly and warfreak2 for their moral support.
One of my colleagues pointed out that it looked as if the kiwi was moonwalking on the spot. This gave me an idea to liven up the site - make the kiwi actually moonwalk across the page header.
Of course, not being one of our sites, we don't have access to the files, so I can't make it permanently happen. What I can do, though, is use a javascript: address in the address bar to play around with the page once it's loaded.
- Visit the site, and wait for it to finish loading.
- Grab the moonwalk JavaScript, paste it into your address bar (making sure it's all on one line) and hit enter.
- Enjoy.
Internet Explorer 6 will only allow 501 characters in the address bar before it fails. It fails silently if you exceed this limit. As a result of this, I started shrinking the code as much as possible, which involved a bit of code golf with a few guys in an IRC channel - we decided to call this "JavaScript Hack Minigolf." The end result was a lean 477 characters. I also worked out what was happening in Opera - the version I've got installed (9.02) appears to, at least by default on Windows, stop the script running after a set period and return things to their initial status. It's apparently fine in 9.24 on Linux, though. I've now discovered that IE wasn't aligning the inserted div properly, and the fix has now brought it back up to 494 characters - thankfully still within IE6's limit. I've also found that IE7 doesn't have the 501-character limit (I haven't checked if there's a higher limit or no limit).
Thanks to Arachnid for playing a round of JSH Minigolf with me, and to Pic, silentcoder, langly and warfreak2 for their moral support.
Currently feeling: Devious
Currently listening to: Roads - Roadrunner United
No comments have been posted on this entry.
Post a comment:
Sorry, comments have been disabled.
Sorry, comments have been disabled.