How to create URL without A tag + A demonstration of the famed IE bug

Monday, June 8, 2009

I want to demonstrate two things. First a simple way to create hyperlink without using the standard A tag with HREF attribute. This works like a normal tag and looks the same. Yet it uses CSS & javascript event handlers to achieve the same effect using a span tag. This makes it potentially immune to crawling by robots.

As a side effect I use this code to demonstrate the IE bug where you click on the link of a site. The site shows up properly in the browser window, yet it actually loads a different site. As you will see from the demonstration that the status bar also displays properly the wrong site. Without further ado here's the example:

Microsoft? nope, we are better :)

The code is:

Microsoft? nope, we are better :)

Look at the status bar and the Address bar of the displayed page to understand the effect. If you are using Netscape/Mozilla or other browsers based on the codebase you will not be able to view the spoof. In fact you will see the actual URL in the address bar.
However the hyperlink, status and the rest will work fine.


Design of Open Media | To Blogger by Blog and Web