showModalDialog is part of IE's DOM object model, Netscape does not support itsee
Simulating Modal Dialog Windows
http://developer.netscape.com/viewsource/goodman_modal/goodman_modal.html
Simulating Modal Dialog Windows
http://developer.netscape.com/viewsource/goodman_modal/goodman_modal.html
window.open("","","alwaysRaised=1")
或者
<body onblur="window.focus()">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE> emu </TITLE>
<META NAME="Author" CONTENT="emu(ston)">
<META NAME="Keywords" CONTENT="javascript">
<META NAME="Description" CONTENT="emu's test page">
<SCRIPT LANGUAGE="JavaScript">
<!--
var isIE = document.all?true:false;
var dlgArgs=null;
function modal(url,arg,windowFeatures){
dlgArgs=arg;
if (isIE){
showModalDialog(url,window,windowFeatures)
}else{
window.open(url, "_blank", "modal=yes,"+windowFeatures.replace(/dialog(\w*)=/g,"$1="));
}
}
function modalless(url,arg,windowFeatures){
dlgArgs=arg;
if (isIE)
showModelessDialog(url,window,windowFeatures)
else
window.open(url, "_blank", "dependent=yes,"+windowFeatures.replace(/dialog(\w*)=/g,"$1="));
}
//-->
</SCRIPT>
</HEAD><BODY>
<button onclick="javascript:modal('http://www.csdn.net','test','dialogWidth=150px;dialogHeight=150px;dialogLeft=0;dialogTop=0')">modal</button>
<button onclick="javascript:modalless('http://www.csdn.net','test','dialogWidth=150px;dialogHeight=150px;dialogLeft=0;dialogTop=0')">modalless</button>
<BR>
</BODY>
</HTML>
dialog窗口中引用参数时不直接使用dialogArguments,而通过:
(document.all==null?opener.dlgArgs:dialogArguments.dlgArgs)
来引用参数。