Open a new window

Discussion in 'JavaScript' started by real_estate, Jul 18, 2006.

  1. #1
    How to open a new Window using javascript function from a Link button?
     
    real_estate, Jul 18, 2006 IP
  2. Will.Spencer

    Will.Spencer NetBuilder

    Messages:
    14,789
    Likes Received:
    1,040
    Best Answers:
    0
    Trophy Points:
    375
    #2
    Do you mean something like this?
    <a href="javascript:var handle=window.open('http://www.example.com')">Example</a>
    Code (markup):
     
    Will.Spencer, Jul 19, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    A more robust method:
    
    <a href="some.html"
       onclick="return !window.open(this.href);">somewhere</a>
    Code (markup):
    If javascript is on and opens the window, all is well.

    If javascript is on and fails to open the window, the link will fire normally.

    If javascript is off, the link fires normally.

    cheers,

    gary
     
    kk5st, Jul 19, 2006 IP
  4. real_estate

    real_estate Guest

    Messages:
    79
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks guys
     
    real_estate, Jul 20, 2006 IP