php 如何使用 HREF 标签打开固定大小的弹出窗口?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1693222/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 03:32:15  来源:igfitidea点击:

How to open a Popup Window with fixed size using HREF tag?

phpasp.nethtml

提问by Rajasekar

I have a link like this

我有一个这样的链接

$contact_url="<a href=rentals_popup.php?id=$row->rentals_id >" . "Contact" . "</a>";

I want to open that page in a different window with

我想在不同的窗口中打开该页面

SMALLER WIDTH AND HEIGHT

更小的宽度和高度

DISABLED MAXIMIZE BUTTON

禁用最大化按钮

Can Anybody help me plz

任何人都可以帮助我 plz

回答by Esben Skov Pedersen

This should work

这应该工作

<a href="javascript:window.open('document.aspx','mywindowtitle','width=500,height=150')">open window</a>

回答by Thomas

Plain HTML does not support this. You'll need to use some Javascript.

纯 HTML 不支持这一点。您需要使用一些 Javascript。

Also, note that large parts of the world are using a popup blocker nowadays. You may want to reconsider your design!

另请注意,当今世界上大部分地区都在使用弹出窗口阻止程序。您可能需要重新考虑您的设计!

回答by Anas Toumeh

since many browsers block popups by default and popups are really ugly I recommend using lightbox or thickbox they are prettier and are not popups they are extra html markups that are appended to your document's body with the appropriate CSS

由于许多浏览器在默认情况下会阻止弹出窗口,而且弹出窗口真的很丑,我建议使用灯箱或粗框,它们更漂亮,而不是弹出窗口,它们是额外的 html 标记,使用适当的 CSS 附加到您的文档正文中

http://jquery.com/demo/thickbox/

http://jquery.com/demo/thickbox/

回答by stanidani

I can't comment "Esben Skov Pedersen" directly, but using the following notation for links:

我不能直接评论“Esben Skov Pedersen”,而是使用以下链接表示法:

<a href="javascript:window.open('http://www.websiteofyourchoice.com');">Click here</a>

In IE, the new browser window appears but the current window navigates to a page which says "[Object]". To avoid this, simple put a "void(0)" behind the javascript function.

在 IE 中,会出现新的浏览器窗口,但当前窗口导航到显示“[Object]”的页面。为了避免这种情况,简单地在 javascript 函数后面放一个“void(0)”。

Source: https://support.microsoft.com/en-us/kb/257321

来源:https: //support.microsoft.com/en-us/kb/257321

回答by AverageAdam

You might want to consider using a divelement pop-up window that contains an iframe.

您可能需要考虑使用div包含 iframe的元素弹出窗口。

JQuery Dialogis a simple way to get started. Just add an iframe as the content.

JQuery Dialog是一种简单的入门方式。只需添加一个 iframe 作为内容