在HTML文件中禁用浏览器中的地址栏和后退按钮 [英] Disable address bar and back button in browser in html file
本文介绍了在HTML文件中禁用浏览器中的地址栏和后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
类似这样的内容:
p>以下是演示: http://jsfiddle.net/n5pKP/5/
JS:
$('。popup ').click(function(){
var curr_browser = navigator.appName;
if(curr_browser ==Microsoft Internet Explorer){
window.opener = self;
}
window.open('http://www.google.com/','null','width = 900,height = 750,toolbar = no,scrollbars = no,location = no,resizable = no ');
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height - 100);
});
HTML:
< a target =_ parenthref =javascript:void(0); class =popup>打开新窗口< / a>
现在开始点击。我想直接以弹出的方式打开它。就像我双击test.html,它应该出现我的html数据和禁用地址栏,并没有后退按钮。
如何完成?
解决方案
您可以尝试像这样
< input id =Button1type =buttonvalue =buttononclick =window.open('WebForm1.aspx','PoP_Up','directories = no,titlebar = no,toolbar = no,location =没有,状态=无,菜单栏=没有,滚动条=没有,可调整大小=无,宽度= 1024,高度= 768' ); />
这在顶级浏览器中得到支持
How can I disable address bar and back button in browser in html file?
Something Like this :
Here is the demo :http://jsfiddle.net/n5pKP/5/
JS:
$('.popup').click(function () {
var curr_browser = navigator.appName;
if (curr_browser == "Microsoft Internet Explorer") {
window.opener = self;
}
window.open('http://www.google.com/', 'null', 'width=900,height=750,toolbar=no,scrollbars=no,location=no,resizable =no');
window.moveTo(0, 0);
window.resizeTo(screen.width, screen.height - 100);
});
HTML:
<a target="_parent" href="javascript:void(0);" class="popup">Open new window</a>
Right now its opening on click. I want to open it directly as popup. Like I double click on test.html , its should appear my html data and disabled address bar and with no back button.
How it can be done?
解决方案
You may try like this
<input id="Button1" type="button" value="button" onclick="window.open('WebForm1.aspx','PoP_Up','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1024,height=768');" />
This is supported in top browser
这篇关于在HTML文件中禁用浏览器中的地址栏和后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文