Javascript toolbar link Help needed

Discussion in 'JavaScript' started by phantom, Oct 30, 2007.

  1. #1
    I have this code so that people can drag this link to their firefox toolbar.
    Is there a way to have it open up a new window or new Firefox tab?
    The slashes are there because the quotes are escaped due to the fact that this is echoed out through php. This is what is throwing me off ....I am not sure how to put in target="_blank".

    Here is the code:
    Drag this  to you toolbar <a href='javascript:void(location.href=\"http://mysite.com/\")'  onmouseover='window.status='';return true' onclick='return false'> mysite.com</a>
    Code (markup):

    Any ideas?
     
    phantom, Oct 30, 2007 IP
  2. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Try this:
    echo "Drag this  to you toolbar <a href='javascript:window.open(\"http://mysite.com/\",\"\",\"\")'  onmouseover='window.status='';return true' onclick='return false'> mysite.com</a>";
    PHP:
    I'm not sure why you'd want to do this, though.
     
    phper, Oct 30, 2007 IP
  3. phantom

    phantom Well-Known Member

    Messages:
    1,509
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    140
    #3
    oh man that is almost it......it opens the new window/tab but it changes the original window..........is there any way to keep the original window in tact?
     
    phantom, Oct 30, 2007 IP