简体   繁体   English

在 HTML 中打开弹出窗口

[英]Opening popup windows in HTML

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?我正在使用网络应用程序,我想知道是否有办法使用 HTML 在应用程序类型窗口中打开链接? Something like this:像这样:

<a href="link" target="_app">My App</a>

Something like this?是这样的吗?

<a href="#" onClick="MyWindow=window.open('http://www.google.com','MyWindow','width=600,height=300'); return false;">Click Here</a>

HTML alone does not support this. HTML本身不支持这一点。 You need to use some JS .你需要使用一些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>

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>

Open a popup, a sample, link with in the same site.在同一站点中打开一个弹出窗口、一个示例和链接。

 <a onclick="window.open('/Product/Product', 'popup', 'location=0,width=750,height=650,left=500,top=55'); return false;" class="btn btn-primary btn-sm">+</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM