简体   繁体   English

从弹出窗口中隐藏地址栏 window

[英]hiding address bar from a pop-up window

i am developing a website, as my website contain different products.. when a user click in any one the product from my list, the product details opens and is shown in another pop-up window.but that pop-up window opens with address bar that contains my product link.我正在开发一个网站,因为我的网站包含不同的产品.. 当用户单击我列表中的任何产品时,产品详细信息将打开并显示在另一个弹出窗口 window 中。但是该弹出窗口 window 以地址打开包含我的产品链接的栏。 Can anyone please help me to hide that pop-up window address bar and if possible status bar also from that pop-up window.谁能帮我隐藏弹出窗口 window 地址栏,如果可能的话,状态栏也可以从弹出窗口 window 中隐藏。

thanks in advance提前致谢

my javascript:我的 javascript:

window.open('sample.aspx?ProdName=" + productname +  "','','height=600,width=930,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,modal=yes')");

You can't.你不能。 Modern browsers prevent popups from concealing the domain of the page they are showing by not providing a mechanism for hiding the address bar.现代浏览器通过不提供隐藏地址栏的机制来防止弹出窗口隐藏它们正在显示的页面的域。

I'd recommend changing the design to avoid popups (which are a horrible piece of UX).我建议更改设计以避免弹出窗口(这是一个可怕的 UX)。

You cant hide the address bar, but you can hide the status bar and toolbar and other things.不能隐藏地址栏,但可以隐藏状态栏和工具栏等。 Here is a good description of the parameters to the window.open() method. window.open()方法的参数的一个很好的描述。

window.open("http://www.my-domain.com", "My Title","status=0,toolbar=0");

In repsonse to comment:回复评论:

window.open("sample.aspx?ProdName=" + productname, "height=600,width=930,status=0,toolbar=0,menubar=0,location=0,scrollbars=1,modal=1");

Have you considered showing an in-browser dialog, using JavaScript such as jQuery dialog ?您是否考虑过使用 JavaScript(例如jQuery 对话框)显示浏览器内对话框

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

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