javascript link help

Discussion in 'JavaScript' started by tamilsoft, May 20, 2008.

  1. #1
    Hi,

    I am using javascript to generate links for my affiliate sites to avoid huge number of outbound links for crawlers [ I don't want to use "nofollow" option].


    It works fine for normal clicks, but if a user trying to right click & "open in new window option", It gives problem....

    Anyone help me to solve this


    thanks in advance
     
    tamilsoft, May 20, 2008 IP
  2. vpguy

    vpguy Guest

    Messages:
    275
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <a href="javascript:void(0);" onclick="this.href='http://www.domain.com/'; return true;">anchor text</a>
     
    vpguy, May 20, 2008 IP
  3. tamilsoft

    tamilsoft Banned

    Messages:
    1,155
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes it works well in FF, but not in IE:(
     
    tamilsoft, May 21, 2008 IP
  4. vpguy

    vpguy Guest

    Messages:
    275
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You're right, sorry. Use onmousedown instead of onclick.
     
    vpguy, May 21, 2008 IP