Easter Egg on jQuery site

Digging around the script on the jQuery.com website I saw there´s an easter egg that uses the Konami cheat code, i.e. up arrow twice, down arrow twice, left arrow, right arrow, left arrow, right arrow, a, b. Rock on!
(Tested in Google Chrome only)


Mysterious additional HTTP GET: beware of the IMG tag!

This morning I solved one of those mysterious problems that cause insomnia, premature baldness and/or random acts of violence such as throwing anything out of the window with an on/off switch.

One of the web forms I’m working on stores an object in the Session scope. The object  is being created on the initial (non-postback) call of the webpage and fetched from the Session on subsequent postbacks. One particular part of the page utilizing AJAX caused the object to be reset to its initial state and that was when the detective work started.

Firebug showed that after loading a dynamic part of the page an additional HTTP GET was done. It turned out to be an IMG tag with an empty src attribute, i.e.

<img src="" />

that was filled in after dynamically inserting the HTML, causing the aforementioned HTTP GET by the browser. The solution was to point the IMG to a valid (empty) image first and overwrite that later.

This reminded me of a similar case I had a long, long time ago in a place near, nearby where a piece of faulty HTML also caused an additional GET. Exercise for the reader:

<body background="#FFF">

(Yes folks, that was in the day that CSS did not exist yet and “Auto-complete” referred to a letter stating that your T-Ford was ready.)

Copying text using Javascript URLs and TinyURL.com: cloud clipboarding!

The company where I’m currently doing a project has two separate networks: one small network that is used by the developers for a new application and
another network, used by the rest of the company, where the application is deployed to.

Today I wanted to copy a small piece of SQL from my PC to the server in the network. Because using a USB memory stick takes too much time (insert the stick, copy the text into a text file, store the file on the stick, etc.) I thought: apart from using webmail, can’t I store the text somewhere on a site and download it from there, preferrably using a small URL?

The first site that comes to mind is tinyurl.com. But I would then have to create a specific page first and shorten the URL afterwards, wouldn’t I?

Good news: tinyurl.com supports javascript URLs! So I simply created a new tinyurl.com link to:

javascript:f();function f(){document.write('<pre>the text that needs to be copied goes here</pre>');}

and opened up http://preview.tinyurl.com/ in a browser on the server and there you go! Cloud clipboarding!


UPDATE: some more Google-ing on the matter revealed two sites that do just this (but easier 😉 which are: http://cl1p.net and http://www.pastebin.com/ Once again this proves that anything you think up already exists somewhere else.