A.html
<html> <head> <title>メインページ</title> <スクリプト言語= "javascript" type = "text/javascript"> function opennew(){var im = new idandmethod(); im.id = document.getElementById( "txtid")。value; window.showmodaldialog( "ddd.html"、im、 ""); }関数idandmethod(){this.id = "ddd"; this.method = settxt; } function settxt(str){document.getElementById( "txtid")。value = str; } </script> </head> <body> <form action = "#"> <input id = "txtid" type = "text" value = "xxx!idを入力してください!" /> <br/> <input type = "button" value = "open new window" onclick = "opennew()"/> </form> </body> </html>b.html
<html> <head> <title>メインページ</title> <スクリプト言語= "javascript" type = "text/javascript"> var im; function load(){im = window.dialogarguments; if(im.id == "xxx!enter id here")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" typent = "text" value = "ddd"/> <br/> <input type = "button" pass "onclick =" set() "/> </form> </body