在 HTML 中打开弹出窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11812161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Opening popup windows in HTML
提问by Arlen Beiler
I am working with web apps, and I am wondering if there is a way to open a link in an app-type window using HTML? Something like this:
我正在使用网络应用程序,我想知道是否可以使用 HTML 在应用程序类型窗口中打开链接?像这样的东西:
<a href="link" target="_app">My App</a>
回答by amitchhajer
Something like this?
像这样的东西?
<a href="#" onClick="MyWindow=window.open('http://www.google.com','MyWindow','width=600,height=300'); return false;">Click Here</a>
回答by Pradeep Kumar Prabaharan
HTML
alone does not support this. You need to use some JS
.
HTML
单独不支持这一点。您需要使用一些JS
.
And also consider nowadays people use popup blocker in browsers.
还要考虑现在人们在浏览器中使用弹出窗口拦截器。
<a href="javascript:window.open('document.aspx','mypopuptitle','width=600,height=400')">open popup</a>
回答by Fuller93
I feel like this is the simplest way. (Feel free to change the width and height values).
我觉得这是最简单的方法。(随意更改宽度和高度值)。
<a href="http://www.google.com"
target="popup"
onclick="window.open('http://www.google.com','popup','width=600,height=600'); return false;">
Link Text goes here...
</a>