Kadjo

SoftDev Journal

About This Journal

24 June 2007 by Jojo Makiling

Technical concerns tend to find a solution as long as there are good people working on them. And Linux has the very best. - Linus Torvalds

A href = “#” with javascript event onclick issue on IE

February 4th, 2009 by pepesmith

I have this kind of link on my code :


< a href = '#' onclick='javascript:window.open("http://somelocation.net/")'>somelocation </a>

The problem with this is that whenever this is clicked in a MS IE browser, both the original link and the new window is executed.
I was expecting that only the new window will be displayed and refresh. To solve this, i’ve changed my code to :


<href = '#' onclick='javascript:window.open("http://somelocation.net/");return false;' >
somelocation <a>

That solves the issue.

Posted in Miscellaneous | 2 Comments »

2 Responses

  1. tildemark Says:

    How about using target attribute? target=”_blank”

  2. C. Bess Says:

    Magandang tanghali

    <a href=’javascript:void(0)’ onclick=’…’

    may be better

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.