请问用什么方法可以弹出窗口? window.open时,如果浏览器设置为多标签,新开的窗口为标签时,就会变成标签了。不是我想要的效果,我想要的效果是类似于alert()这种,弹出窗口在当前页面上,是一个小窗口请问有什么办法可以实现,谢谢!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /* Winopen 使用说明:弹出页必须加<base target="_self">,否则提交时会弹出新窗口 最好也加入: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="0"> 否则页面被缓存会造成更改页面后不能显示为最新的 Parameter详解: 1. dialogHeight: 对话框高度,不小于100px 2. dialogWidth: 对话框宽度。 3. dialogLeft: 离屏幕左的距离。 4. dialogTop: 离屏幕上的距离。 5. center: { yes | no | 1 | 0 } : 是否居中,默认yes,但仍可以指定高度和宽度。 6. help: {yes | no | 1 | 0 }: 是否显示帮助按钮,默认yes。 7. resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改变大小。默认no。 8. status:{yes | no | 1 | 0 } [IE5+]:是否显示状态栏。默认为yes[ Modeless]或no[Modal]。 9. scroll:{ yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。 示例:WinOpen('test.html','test','dialogHeight:300px;dialogWidth:200px;help:no;status:no;')*/function Winopen(PageUrl,title,parameter) { var sRet = window.showModalDialog(PageUrl,title,parameter); if(sRet == "refresh") {window.location.reload();} }参考下,怎么用当中有 showModalDialog倒是可以,但是它老是弹出“该页包含未知的潜在安全隐患,是否继续?” 测试代码:<script>function Winopen(PageUrl,title,parameter) { var sRet = window.showModalDialog(PageUrl,title,parameter); if(sRet == "refresh") {window.location.reload();} }</script><input type="button" onclick="WinOpen('welcome.html','test','dialogHeight:300px;dialogWidth:200px;help:no;status:no;')">点击时报错:缺少对象 <div id="box" style="position:absolute;left:0;top:0;width:300px;height:200px;"></div><script>var id = document.getElementById('box');var Width = document.documentElement.clientWidth ;var Height = document.documentElement.clientHeight ;var selfW = id.style.width ;var selfH = id.style.height ;id.style.left = (Width-selfW)/2+"px";id.style.top = (Height-selfH)/2+"px";</script>绝对居中显示 WinOpen和window.showModalDialog都可以,只是后者传值时稍微有点麻烦 IE-->Internet选项-->更改网页选项卡方式-->始终已新窗口打开 WinOpen和window.showModalDialog都可以,只是后者传值时稍微有点麻烦 页面回访【求教】 jquery的一个技术问题 Extjs3.0 简单正则问题 请教 javascript 判断日期格式,当日期为空的时候不判断,代码如何写? 求测试这个Jquery实现的纵向菜单在IE6下的效果。 如何调一个写在数组内的JS函数? 好久没来了,也散一贴,中秋快乐 如何从全个文件夹中依次读出图片文件 关于页面刷新的问题,急急急急急,在线等待,,给分 如何在intrweb中访问页面生成的表格 为什么我这段JS代码不起作用!!
/*
Winopen 使用说明:弹出页必须加<base target="_self">,否则提交时会弹出新窗口
最好也加入:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
否则页面被缓存会造成更改页面后不能显示为最新的
Parameter详解:
1. dialogHeight: 对话框高度,不小于100px
2. dialogWidth: 对话框宽度。
3. dialogLeft: 离屏幕左的距离。
4. dialogTop: 离屏幕上的距离。
5. center: { yes | no | 1 | 0 } : 是否居中,默认yes,但仍可以指定高度和宽度。
6. help: {yes | no | 1 | 0 }: 是否显示帮助按钮,默认yes。
7. resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改变大小。默认no。
8. status:{yes | no | 1 | 0 } [IE5+]:是否显示状态栏。默认为yes[ Modeless]或no[Modal]。
9. scroll:{ yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。
示例:WinOpen('test.html','test','dialogHeight:300px;dialogWidth:200px;help:no;status:no;')
*/
function Winopen(PageUrl,title,parameter)
{
var sRet = window.showModalDialog(PageUrl,title,parameter);
if(sRet == "refresh")
{window.location.reload();}
}
参考下,怎么用当中有
“该页包含未知的潜在安全隐患,是否继续?”
<script>
function Winopen(PageUrl,title,parameter)
{
var sRet = window.showModalDialog(PageUrl,title,parameter);
if(sRet == "refresh")
{window.location.reload();}
}
</script>
<input type="button" onclick="WinOpen('welcome.html','test','dialogHeight:300px;dialogWidth:200px;help:no;status:no;')">点击时报错:缺少对象
var id = document.getElementById('box');
var Width = document.documentElement.clientWidth ;
var Height = document.documentElement.clientHeight ;
var selfW = id.style.width ;
var selfH = id.style.height ;
id.style.left = (Width-selfW)/2+"px";
id.style.top = (Height-selfH)/2+"px";
</script>绝对居中显示