a.html
<html> <head> <title> Основная страница </title> <script language = "javascript" type = "text/javascript"> function opennew () {var im = new idandMethod (); im.id = document.getElementById ("txtId"). value; window.showmodaldialog ("ddd.html", im, ""); } function idandMethod () {this.id = "ddd"; this.method = centxt; } function settxt (str) {document.getElementById ("txtId"). value = str; } </script> </head> <body> <form action = "#"> <input id = "txtid" type = "text" value = "xxx! Введите идентификатор здесь!" /> <br/> <input type = "button" value = "Открыть новое окно" onclick = "opennew ()"/> </form> </body> </html>B.html
<html> <head> <title> Главная страница </title> <script language = "javascript" type = "text/javascript"> var im; function load () {im = window.dialogarguments; if (im.id == "xxx! Введите идентификатор здесь") document.getElementById ("txtId1"). value = "Вы бы введили его каким -либо образом!"; else Document.getElementById ("txtId1"). value = im.id; } function set () {im.method (document.getElementById ("txtId1"). Value); } </script> </head> <body onload = "load ()"> <form action = "#"> <input Id = "txtid1" type = "text" value = "ddd"/> <br/> <input type = "value =" pass data "onclick =" set () "/> </form> </body> </html>