how to open in new window

后端 未结 3 1913
别跟我提以往
别跟我提以往 2020-12-19 14:45

i have another problem :( this is my script



        
相关标签:
3条回答
  • 2020-12-19 15:17

    Try window.open. This will open a new window:

    window.open("http://www.google.com");
    

    See also:

    • MDN: window.open usability issues
    0 讨论(0)
  • 2020-12-19 15:28

    If you are opening in a new window, you don't need to check with the user about navigating away.

    function first()
        {
               window.open("http://www.yahoo.com.sg")
        }
        function second()
        {
            window.open"http://www.google.com")
        }
    
    0 讨论(0)
  • 2020-12-19 15:34

    Use the window.open method and specify _blank as the target:

    window.open('http://www.yahoo.com.sg', '_blank');
    

    This will open the page in a new window or a new tab, depending on the user settings in the browser.

    If you want it to open in a new popup window always, you can specify a parameter string with width and height for the window. However, most browsers will block such a popup that opens a page from a different domain.

    0 讨论(0)
提交回复
热议问题