msdn的例子<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Example of the showModelessDialog Method</TITLE><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<META NAME="AUTHOR" CONTENT="InetSDK">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="ROBOTS" CONTENT="noindex"><!-- STYLE_START -->
<LINK REL="stylesheet" HREF="../../../../../workshop/basicsdkie4.css" TYPE="text/css">
<LINK REL="stylesheet" HREF="../../../../../workshop/advsdkie4.css" TYPE="text/css">
<!-- STYLE_END --><SCRIPT DEFER SRC="../../../../../workshop/code/common.js"></SCRIPT>
<SCRIPT DEFER SRC="../../../../../msdn-online/shared/js/toc.js"></SCRIPT>
<SCRIPT>
// All code in this script tag belongs to showModelessDialog sample.var sUserName="";              // Supplies a return value from modeless dialog box
var oDialog = "myDialog.htm";  // Passes URL and filename of dialog box as a variable
var bDialogStatus = false;     // Indicates whether modeless dialog box is currently open/*------------------------------------------------------------The fnCallDialog function invokes showModelessDialog passing the following parameters:
  sURL: oDialog
  vArguments: window
  sFeatures: status and dialog*Supplying the window object as a parameter allows for declaring the global variable, sUserName, and using it to return information from the modeless dialog box.The Boolean bDialogStatus enables a check for whether the modeless dialog box is already open.
If it is already open, then the browser gives it focus rather than opening another instance
of the dialog box. 
------------------------------------------------------------- */function fnCallDialog()                                             
{
  showModelessDialog(oDialog,window,"status:false;dialogWidth:300px;dialogHeight:300px");
}/* Reed out until RTM when focus is implemented on modeless dialog boxes.
  if ( bDialogStatus == false ) 
    {
      showModelessDialog(oDialog,window,"status:false;dialogWidth:300px;dialogHeight:300px");
  bDialogStatus = true;
    }
  else
      oDialog.focus();
*//*-------------------------------------------------------------The fnUpdate function takes the value passed into sUserName in myDialog.htm to update
the span text on this page. This function is called in both fnGetInfo and fnCancel
functions in myDialog.htm.
-------------------------------------------------------------*/function fnUpdate()
{
  oName.innerText = sUserName;
}</SCRIPT>
</HEAD>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END--><BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF" 
LINK="#000000" VLINK="#808080" ALINK="#000000">
<BLOCKQUOTE CLASS="body"><!-- CONTENTS_START -->
<H1>Example of the showModelessDialog Method</H1>
<P>This page demonstrates the Internet Explorer modeless dialog box. Click the button to open the modeless dialog box.</P>
<P>When showModelessDialog is invoked, the window object is passed as the second argument. Doing so enables the creation of a global variable that can be used to supply a return value. The return value is passed using the dialogArguments parameter from the modeless dialog box back to the window that called it.</P>
<BR>
<P>Enter your first name: <SPAN ID="oName" STYLE="color:red;font-size:24">Joan</SPAN></P>
<INPUT TYPE="button" VALUE="Display Modeless Dialog" onclick="fnCallDialog()"><BR><BR><!-- CONTENTS_END --><!-- START_PAGE_FOOTER -->
<BR><BR><BR>
&copy; <A CLASS="clsIncCpyRt" HREF="http://msdn.microsoft.com/isapi/gomscom.asp?target=/misc/cpyright.htm" TARGET="_top">2000 Microsoft Corporation. All rights reserved. Terms of use</A>.
<!-- END_PAGE_FOOTER -->
</BLOCKQUOTE>
</BODY>
</HTML><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>untitled</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<META NAME="AUTHOR" CONTENT="InetSDK">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="ROBOTS" CONTENT="noindex"><SCRIPT>/* -------------------------------------------------------------
This function makes use of the dialogArguments property of the
window object. dialogArguments allows the global variable sUserName
to feed the value supplied to the input in this dialog box back to
the window that called it.
---------------------------------------------------------------- */function fnGetInfo()
{
  var sData = dialogArguments;
  sData.sUserName = oEnterName.value;
  sData.fnUpdate();
}/* -------------------------------------------------------------
This function cleans up in case the user has clicked the 
Apply button before canceling.
---------------------------------------------------------------- */function fnCancel()
{
  var sData = dialogArguments;
  sData.sUserName = "Joan";
  sData.fnUpdate(); 
}
</SCRIPT>
下面是myDialog.htm的
<!-- SAMPLE_STYLE_START -->
<LINK REL="stylesheet" HREF="../../../../../workshop/basicsdkie4.css" 
TYPE="text/css">
<!-- SAMPLE_STYLE_END -->
</HEAD>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END--><BODY onbeforeunload="bDialogStatus=false" STYLE="padding:10" TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF" 
LINK="#000000" VLINK="#808080" ALINK="#000000">
<BLOCKQUOTE CLASS="body"><LABEL FOR="oEnterName" ACCESSKEY="f">Enter your <SPAN STYLE="text-decoration:underline">F</SPAN>irst Name</LABEL>
<INPUT ID=oEnterName><BR><BR>
<INPUT VALUE="Apply" TYPE=button onclick="fnGetInfo();">
<INPUT VALUE="Ok" TYPE=button onclick="fnGetInfo();window.close();">
<INPUT VALUE="Cancel" TYPE=button onclick="fnCancel();window.close();"><!-- START_PAGE_FOOTER -->
<!--@ File doesn't require CR statement-->
<!-- END_PAGE_FOOTER -->
</BLOCKQUOTE>
</BODY>
</HTML>

解决方案 »

  1.   

    模态窗体有 arguments 参数可以传递的
      

  2.   

    showmodaldialog函数中,第二个参数就是你要传入的参数,你可以在这里传参数,然后在模态窗户里面用dialogArgument句柄来获得传入的参数
      

  3.   

    showModelessDialog(oDialog,window,"status:false;dialogWidth:300px;dialogHeight:300px");
    }
    里面把window这个对象作为参数传给对话框,在对话框里面使用dialogArguments来引用传来的window对象(实参,形参),所以调用
      var sData = dialogArguments;
      sData.sUserName = "Joan";
    就是修改了原来网页的sUserName;
      sData.fnUpdate(); 
    就是调用原来的网页的fnUpdate来更新的。
      

  4.   

    软件名称:百无趣(电影吧)全站程序3.0版!
    介绍:提供全套影视链接维护,设置。电影发布修改等功能,全部动态,纯ASP代码编写。
    软件网站:http://www.buy57.com
    http://www.buy57.com/down/buy57.com.rar   
    软件类型:国产软件 / 简体中文 / 共享软件
    应用平台:Win95/98/NT/2000/XP