a.html
<html> <fead> <title> Página principal </title> <script language = "javascript" type = "text/javaScript"> function openNew () {var im = new IdandMethod (); im.id = document.getElementById ("txtid"). valor; Window.ShowModalDialog ("ddd.html", im, ""); } función idandMethod () {this.id = "ddd"; this.method = settxt; } function settxt (str) {document.getElementById ("txtid"). valor = str; } </script> </head> <body> <form de acción = "#"> <input id = "txtid" type = "text" value = "xxx! Ingrese ID aquí!" /> <Br/> <input type = "Button" Value = "Open New Window" onClick = "OpenNew ()"/> </form> </body> </html>b.html
<html> <fead> <title> Página principal </title> <script language = "javascript" type = "text/javaScript"> var im; function load () {im = window.dialogarGuments; if (im.id == "xxx! Ingrese id aquí") document.getElementById ("txtid1"). Value = "¿Lo ingresaría de alguna manera!"; else document.getElementById ("txtid1"). valor = im.id; } function set () {im.method (document.getElementById ("txtid1"). valor); } </script> </head> <body onload = "load ()"> <form de acción = "#"> <input id = "txtid1" type = "text" value = "ddd"/> <br/> <input type = "button" value = "pasar datos" en ondclick = "set ()"/> </form> </body> </html>