<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>1233214</title>
<script type="text/javascript">
function Jz() {
window.showModalDialog("xxoo", "jsj", 'dialogHeight:250px;dialogWidth:300px;center:yes;status:no');
}
</script>
</head>
<body onload="Jz()">
<form id="form1" runat="server" >
<div>
</div>
</form>
</body>
</html>
我用 showModalDialog 传递页面路径的时候 不能写上当前页面,这样会造成死循环 不停的执行 onload事件,求高人指点,求教育...
<script type="text/javascript">(function(){
var l=window.location.href;
if(l.indexOf("NewWindow")==-1){
if(l.indexOf("?")>-1){
l=l+"&NewWindow="+Math.random();
}else{
l=l+"?NewWindow="+Math.random();
}
window.showModalDialog(l,'newwindow');
window.open('', '_self');
window.close();
}
})()
</script>
写在文档的头上,不是很完美,但是可以用