- One: Gets the value from the parent page
There are two ways to Windows.open () and Windows.showmodaldialog ()
1.windos.open (Url,name,reatures,replace)
Fatherpage.aspx in the parent page
<script type= "Text/javascript" >
function A () {
Windows.open ("sonpage.aspx")
}
</script>
Gets the objects, values in the parent page (sonpage.aspx) in the child page
<script type= "Text/javascript" >
var Text=windows.opener.document.getelementbyid ("TextBox1"). Value;
Alert (text)
</script>
2.windows.showmodaldialog (Url,name,??,??,??)
In the parent page
<script language= "JavaScript" >
function Popwindow (){
window.showModalDialog (sonpage.aspx ', window);
}
</script>
get values in a sub-page
<script language= "JavaScript" >
var vwin = window.dialogarguments; Get window Parameters
var doc = vwin.document.getElementById ("TextBox1"). Value; Get the value of a textbox
Alert (DOC);
</script>
- gets the value of the child page callback in the parent page
Use JavaScript to set, get values from parent-child pages