window.parent.location=window.parent.location.href;
window.close();

解决方案 »

  1.   

    抱歉,如果你是用 window.open 開啟窗口的話,要改用:
    window.parent.location=window.parent.location.href;
    window.close();
      

  2.   

    抱歉,抱歉,上面一篇又打錯,如果你是用 window.open 開啟窗口的話,要改用 opener 的方式才對: 
    window.opener.location=window.opener.location.href;
    window.close();
      

  3.   

    不是用WINDOW.Open开的
    这样:
    window.showModalDialog('mainrepair.asp?repair='+thisvalue+'&id='+id+'&refresh='+number,'_blank','dialogLeft:400px;dialogtop:400px;dialogwidth:'+widthp+'px;dialogheight:'+heightp+'px;status=0;scroll=0');
      

  4.   

    模态对话框是不能用opener引用父窗口的,而是需要父窗口主动传递指针变量的 
    这个window.showModalDialog有第二个参数,就是做这个用的,你需要把window穿过去,就是这样 
    var returnValue=showModalDialog('2.html',window,'dialogWidth:520px;dialogHeight:510px;help:no;center:yes;resizable:no;status:no;scroll:no'); 
    这样在对话框中就可以引用父窗口对象,怎么引用呢,通过window.dialogArguments就可以应用父窗口了。 
    在body里面加上location <body onUnload="window.dialogArguments.location.reload()">