Have you people ever noticed that for a hyperlink of type

<a href=“#”>test</a>

after clicking causes the window scroll position to move upwards giving a weird sense of behaviour to the link.

I just managed to find out a workaround for this problem.What I did was I re-coded the hyperlink in the following manner

<a href=“javascript:void(0);” >test</a>

Here I am doing nothing but replacing the # with a null javascript, but here I have to assume that the javascript in your friendly browser is enabled.

Another work around is

<a href=“#” onclick=“javascript:alert(’test’);return false;”>test</a>

here the return false tell the browser to do nothing once the alert is displayed.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • blogmarks
  • Book.mark.hu
  • co.mments
  • Technorati
  • YahooMyWeb
  • IndianPad
  • DZone