a.html
<html> <éad- head> <ititle> page principale </ title> <script linguisse = "javascript" type = "text / javascript"> function openNew () {var im = new idAndMethod (); im.id = document.getElementById ("txtid"). valeur; window.showmodaldialog ("ddd.html", im, ""); } fonction idandMethod () {this.id = "ddd"; this.Method = setXt; } fonction settxt (str) {document.getElementById ("txtid"). valeur = str; } </ script> </ head> <body> <form action = "#"> <input id = "txtid" type = "text" value = "xxx! Entrez id ici!" /> <br /> <input type = "Button" value = "ouvrir une nouvelle fenêtre" onClick = "openNew ()" /> </ form> </ body> </html>b.html
<html> <éad- head> <ititle> page principale </ title> <script linguisse = "javascript" type = "text / javascript"> var im; Fonction Load () {im = window.dialogarguments; if (im.id == "xxx! Entrez id ici") document.getElementById ("txtid1"). Value = "Souhaitez-vous l'entrer de quelque manière que ce soit!"; else document.getElementById ("txtid1"). valeur = im.id; } fonction set () {im.Method (document.getElementyId ("txtid1"). valeur); } </ script> </ head> <body onload = "load ()"> <form action = "#"> <input id = "txtid1" type = "text" value = "ddd" /> <r /> <input type = "button" value = "pass data" onclick = "set ()" /> </ form> </body> </html> onclick = "set ()" /> </ form> </body> </html> onClick = "