读书人

模态窗口封闭时刷新父窗口(js)

发布时间: 2013-10-30 12:56:22 作者: rapoo

模态窗口关闭时,刷新父窗口(js)
function findDetailsForAmount(outputBillDetailId,applyAmount,outputAmount){var url = "/innerallocateDetailAction.do?method=findDetailsForAmount&outputBillDetailId="+outputBillDetailId+"&applyAmount="+applyAmount+"&outputAmount="+outputAmount;var answer=window.showModalDialog(url,window,"dialogWidth=450px;dialogHeight=200px;scroll:no");if(answer==1){ // 返回值如果为1window.location.reload(); // 刷新父窗口}}

?
打开的模态窗口js:

//窗口关闭时执行window.onunload=function(){window.returnValue=1;   //父窗口中 answer的值}

?

方式2:直接在打开的模态窗口操作
打开的模态窗口js:

//窗口关闭时执行window.onunload=function(){var parentWin=window.dialogArguments;parentWin.location.reload(); //刷新父窗口}

?

?

?

读书人网 >JavaScript

热点推荐