http://www.csdn.net/Develop/Read_Article.asp?Id=15113

解决方案 »

  1.   

    there are two mechanisms, one is through the return value of showModalDialog, the other is through the second parameter of showModalDialog, for examplemain.html:
    <input type="text" id="txt1">
    <script>
    var ret = showModalDialog("child.html", window);//pass the current window object
    if (ret != null)
     document.getElementById("txt1").value = ret;
    </script>child.html:
    <script>
    var opener = window.dialogArguments;
    opener.document.getElementById("txt1").value = "123";//set the value directly
    window.returValue = "123";//will pass to "ret" in main.html