使用javascript禁用地址栏打开窗口 [英] open window using javascript disable address bar

查看:111
本文介绍了使用javascript禁用地址栏打开窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨everyboby。我在浏览器中编写了函数打开新窗口。我想禁用地址栏

  window  .open('   / login.html''  winname '
目录= 0 ,titlebar = 0 ,toolbar = 0 location = 0 ,status = 0
menubar = 0 ,scrollbars = no,resizable = no,
width = 400 ,height = 350 );





但它在新版Firefox中不起作用。



感谢everboby

解决方案

< blockquote>

Firefox 3注意:



在Firefox 3中,dom.disable_window_open_feature.locatio n现在默认为true,强制存在位置栏,就像在IE7中一样。有关详细信息,请参阅错误337344.



请参阅此处的详细信息: https://developer.mozilla.org/en-US/docs/Web/API/Window/open?redirectlocale=en-US&redirectslug=DOM %2Fwindow.open [ ^ ]


除了提供信息的解决方案1和2,我还会加上我的建议:



您的设计弹出新窗口(或可能是新选项卡)。这种弹出窗口经常会刺激用户;首先,因为滥用了许多广告商的弹出窗口,也因为它们一般都很不方便。因此,许多用户通常使用某些浏览器的插件来阻止此类弹出窗口。如果您使用页面模式对话框模拟所需的模态行为,您的工作看起来会更好,就像在jQuery UI中找到的那样: http:// jqueryui .com / dialog [ ^ ]。



有许多第三方插件提供了大量有用的效果,例如页面其余部分的调暗等等。请参阅: http://bit.ly/1EKp8je [ ^ ]。



-SA




  1. 将选项放在引号周围,如下所示:

      window  .open('  / login.html''  winname' 目录= 0,标题栏= 0,工具栏= 0,位置= 0,状态= 0,菜单栏= 0,滚动条=无,可调整大小=无,宽度= 400,高度= 350); 



  2. 正如Kornfeld Eliyahu Peter在答案中已提到的那样, dom.disable_window_open_feature.location 现在默认为如果你想改变它,请转到 about:config 并将其设置为false 。


Hi everyboby. I wrote function open new window in browser. i wanna disable address bar

window.open('/login.html', 'winname', 
  directories=0,titlebar=0,toolbar=0,location=0,status=0,     
    menubar=0,scrollbars=no,resizable=no,
      width=400,height=350);



but it not work in new version Firefox.

thanks everboby

解决方案

Firefox 3 note:


In Firefox 3, dom.disable_window_open_feature.location now defaults to true, forcing the presence of the Location Bar much like in IE7. See bug 337344 for more information.


See details here: https://developer.mozilla.org/en-US/docs/Web/API/Window/open?redirectlocale=en-US&redirectslug=DOM%2Fwindow.open[^]


In addition to informative Solutions 1 and 2, I would add my advice:

Your design pop-ups the new window (or possibly a new tab). Such pop-ups often irritates the users; first of all, because the abuse of many advertisers' pop-ups, but also because they are pretty inconvenient in general. Therefore, many users block such pop-ups, usually using some browsers' plug-ins. Your work will look much better is you simulate the modal behavior you need using on-page modal dialog, like the one found in jQuery UI: http://jqueryui.com/dialog[^].

There are many 3rd party plug-ins offering good number of useful effects, such as dimming of the rest of the page, and a lot more. Please see: http://bit.ly/1EKp8je[^].

—SA



  1. Put the options around quotes, like this:

    window.open('/login.html', 'winname',"directories=0,titlebar=0,toolbar=0,location=0,status=0,menubar=0,scrollbars=no,resizable=no,width=400,height=350");


  2. As Kornfeld Eliyahu Peter already mentioned in his answer, dom.disable_window_open_feature.location now defaults to true, to force the location bar to be there.

    If you want to change that, go to about:config and set it to false.


这篇关于使用javascript禁用地址栏打开窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆