首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2013-10-30 
模态窗口关闭时,刷新父窗口(js)function findDetailsForAmount(outputBillDetailId,applyAmount,outputAmo

模态窗口关闭时,刷新父窗口(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(); //刷新父窗口}

?

?

?

热点排行