function closeit(){
window.returnValue=divlist.alt;
window.close();
}

解决方案 »

  1.   

    点右上角的那个按钮是扑捉不到onunload事件的,可以再showModalDialog上加一个关闭按钮,执行top.close()
      

  2.   

    <input type=button onclick="window.close()">
      

  3.   

    就是像3楼说的<body onunload="window.returnValue='你要的值'">
      

  4.   

    可能可以在接收方进行判断:
    str=window.showModalDialog("aa.htm","","")
    if(str!=undefined)
      {
       进行赋值!
       }