Dar*_*ney 3 html javascript window.open
我试图在弹出窗口中打开页面,而不是在新选项卡中打开页面 - 但无论我尝试使用哪种浏览器,都会在新选项卡中打开页面,而不是弹出窗口。
<input type="button" value="new win" onclick="window.open('http://yahoo.com', 'width=500, height=400')" />
Run Code Online (Sandbox Code Playgroud)
有什么理由吗?
第二个参数必须是窗口名称:
<input type="button" value="new win"
onclick="window.open('http://yahoo.com', 'mywindow', 'width=500, height=400')" />
Run Code Online (Sandbox Code Playgroud)
在 Chrome 和 Firefox 中工作正常:
| 归档时间: |
|
| 查看次数: |
15122 次 |
| 最近记录: |