1.
/*******************************************************
ttt.htm
*******************************************************/
<html>
<head>
<META HTTP-EQUIV= "pragma " CONTENT= "no-cache ">
<META HTTP-EQUIV= "Cache-Control " CONTENT= "no-cache, must-revalidate ">
<META HTTP-EQUIV= "expires " CONTENT= "Mon, 23 Jan 1978 12:52:30 GMT ">
<title> 标题 </title>
</head>
<body>
<div id=haha> </div>
<center> <input type=button value=确定 οnclick= "window.close() "> </center>
</body>
<script language=javascript>
if (window.dialogArguments != null)
{
var ww = window.dialogArguments;
document.all.haha.innerHTML = ww.mm;
}
</script>
</html>
/*******************************************************
test.htm
*******************************************************/
<script language=javascript>
var mm = " ";
window.alert = function(str)
{
mm = str; //提示的文本
showModalDialog( 'ttt.htm ', window, 'dialogWidth: 240px; dialogHeight: 100px; status: no; help: no ');
}
window.alert("123456789");
</script>
/*******************************************************
其他注释
*******************************************************/
alert(msg);
var isConfirmed = confirm(msg);//确定返回true,取消返回false
var text = prompt('标题','请输入内容');//text为用户输入的值,默认为“请输入内容”