How to use window.open in javascript?

Discussion in 'HTML & Website Design' started by mpdevelopers, Oct 19, 2011.

  1. #1
    How to open a link on the same window using window.open in javascript.:eek:
     
    mpdevelopers, Oct 19, 2011 IP
  2. Armfun

    Armfun Member

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Do you want to open it in iframe???
     
    Armfun, Oct 23, 2011 IP
  3. yho_o

    yho_o Well-Known Member

    Messages:
    354
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    #3
    javascript

    <script type="text/javascript">
    function new_win() {
    window.open("http://www.google.com")
    }
    </script>
    Code (markup):
    button to call the function

    <input type=button value="Go To Google" onclick="new_win()" />
    Code (markup):
    Good Luck, hope it helps
     
    yho_o, Oct 23, 2011 IP
  4. mpdevelopers

    mpdevelopers Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I want to open a page on the same window, i think this code will open a new window.
     
    mpdevelopers, Nov 3, 2011 IP