日期:2014-05-16 浏览次数:20324 次
<HTML>
<HEAD>
<TITLE>showModelessDialogEX.htm</TITLE>
<SCRIPT>
var sUserName="";
var m = null;
function fnCallDialog(){
if(m && !m.closed)
m.close();
if(!m
------解决方案--------------------
m.closed)
{
m = showModelessDialog("myDialog.html",window,"status:false;dialogWidth:300px;dialogHeight:300px");
}
}
function fnUpdate(){
document.getElementById("oName").innerText = sUserName;
}
</SCRIPT>
</HEAD><BODY>
<P>Enter<SPAN STYLE="color:red;font-size:24" id="oName">JoyoShuai</SPAN></P>
<INPUT TYPE="button"
VALUE="Display Modeless Dialog" onclick="fnCallDialog()">
<INPUT TYPE="button"
VALUE="redirect Dialog" onclick="m.document.getElementById('linkA').click()">
<INPUT TYPE="button"
VALUE="Display Modeless Dialog Again" onclick="fnCallDialog()">
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>myDialog.htm</TITLE>
<base target="_self"></base>
<SCRIPT>
function fnGetInfo() {
var sData = dialogArguments;
sData.sUserName = document.getElementById("oEnterName").value;
sData.fnUpdate();
}
function fnCancel() {
var sData = dialogArguments;
sData.sUserName = "Joan";
sData.fnUpdate();
}
</SCRIPT>
</HEAD>
<BODY>
Enter your <SPAN STYLE="text-decoration:underline">F</SPAN>irst Name</LABEL>
<INPUT id="oEnterName"><INPUT VALUE="Apply" TYPE=button onclick="fnGetInfo();" >
<INPUT VALUE="Ok" TYPE=button onclick="fnGetInfo();window.close();" >
<INPUT VALUE="Cancel" TYPE=button onclick="window.close();">
<a id="linkA" href="http://www.baidu.com" style="display:none">baidu</a>
</BODY>
</HTML>