How to open a link in a specified, open window

前端 未结 1 1542
滥情空心
滥情空心 2021-01-20 13:41

I have this web application which has integrations into other webapps like Salesforce.

Now I have a link in Salesforce which opens a new wi

相关标签:
1条回答
  • 2021-01-20 14:21

    You can give a name to the window you opend.

    <a href="#" onclick="window.open('http://www.stackoverflow.com', 'mywin'); return false;">Click here to open window first</a>
    <br/>
    <a href="#" onclick="window.open('http://www.google.com', 'mywin'); return false;">Open link in specific window</a>
    


    Edit

    You can name a window (or tab) on some browsers.

    <script>
        this.name = "mywin";
    </script>
    

    And open a link to the tab.

    <a href="http://www.stackoverflow.com" target="mywin">Open link in specific window</a>
    

    It works on IE, but not Chrome...

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