Test.htm
===================
<script>
window.showModalDialog("a.htm",window)
</script>
a.htm
==============
<html>
<title>ok</title>
<body>
<input type=button onclick="sx()">
</body><script>
function sx()
{
document.write(document.documentElement.outerHTML.replace(/<title>ok<\/title>/i,'<title>dddddddddd</title>'))
}
</script>
===================
<script>
window.showModalDialog("a.htm",window)
</script>
a.htm
==============
<html>
<title>ok</title>
<body>
<input type=button onclick="sx()">
</body><script>
function sx()
{
document.write(document.documentElement.outerHTML.replace(/<title>ok<\/title>/i,'<title>dddddddddd</title>'))
}
</script>
=======================
<script>
var i = 0
window.showModalDialog("a.htm",window)
</script>
a.htm
=================
<html>
<title>ok</title>
<body>
<div id=x>
<input type=button onclick="sx()" value="改变Title">
其它内容
</div>
</body>
<script>
function sx()
{
document.write(document.documentElement.outerHTML.replace(/<title>ok<\/title>/i,'<title>改变Title</title>'))
dialogArguments.i++
if(dialogArguments.i>1)
{
for(j=0;j<document.getElementsByTagName("DIV").length-1;j++)
if(document.getElementsByTagName("DIV")[j].id=="x")
document.getElementsByTagName("DIV")[j].parentNode.removeChild(document.getElementsByTagName("DIV")[j])
}
}
</script>
===========================
<script>
window.showModalDialog("a.htm",window)
</script>a.htm
===========================
<html>
<title>myOldTitle</title>
<body>
</body>
<script>
sx();
function sx()
{
document.title="MyNewTitle";
}
</script>测试通过!
DialogArgument["src"]="YourUrl";
DialogArgument["title"]="YourTitle";
var a=showModalDialog("DialogFrame.jsp",DialogArgument, "status:no;resizable:no; help:no;dialogHeight:400px;dialogWidth:660px;"); </script>
-----------DialogFrame.jsp------------<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language=javascript> var DialogArgument=window.dialogArguments;
if (DialogArgument!=null) document.write("<title>"+DialogArgument.title+"</title>");
else document.write("<title>Dialog</title>");
</script>
<title>Dialog</title>
</head><body leftMargin=0 rightMargin=0 topMargin=0 bottomMargin=0 onload="initFun();">
<iframe src="about:blank" width=100% height=100% id=dialogIframe></iframe>
</body></html>
<script language=javascript>function initFun()
{ if (DialogArgument!=null) document.all.dialogIframe.src=DialogArgument.src;
else alert('Sorry! Perhaps you are use this page wrongly');
}
</script>