ppt-父子窗体

MainFrame:

<HTML>
<HEAD>
<SCRIPT>
function fnLaunch()
{
var aForm;
aForm = oForm.elements;//返回表单元素的各个子元素的集合--使得aForm就代表表单了
var myObject = new Object();//建立一个新的对象
myObject.firstName = aForm.oFirstName.value;
myObject.lastName = aForm.oLastName.value;
// The object "myObject" is sent to the modal window.
window.showModalDialog("modalDialogSource.htm", myObject, "dialogHeight:300px; dialogLeft:200px;");
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON >Launch The Window</BUTTON>
<FORM ID= "oForm">
First Name:
<INPUT TYPE="text" NAME="oFirstName" VALUE="Jane">
<BR>
Last Name:
<INPUT TYPE="text" NAME="oLastName" VALUE="Smith">
</FORM>
</BODY>
</HTML>

 

 

Children Frame:

<HTML>
<HEAD>
<SCRIPT>
var oMyObject = window.dialogArguments;//获取从父窗口传过来的对象
var sFirstName = oMyObject.firstName;
var sLastName = oMyObject.lastName;
</SCRIPT>
<title>Untitled</title>
</head>
<BODY STYLE="font-family: arial; font-size: 14pt; color: red;"
>
First Name:
<SPAN STYLE="color:yellow">
<SCRIPT>
document.write(sFirstName);
</SCRIPT>
</SPAN>
<BR>
Last Name:
<SPAN STYLE="color:00ff7f">
<SCRIPT>
document.write(sLastName);
</SCRIPT>
</SPAN>
</BODY>
</HTML>
 

你可能感兴趣的:(JavaScript,js,Web,职场,休闲)