Home  >  Article  >  Web Front-end  >  javascript showModalDialog multi-layer modal window code to implement page submission and refresh_javascript skills

javascript showModalDialog multi-layer modal window code to implement page submission and refresh_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:41:031000browse

In the modal page of layer N (N>1), if you want to link to other pages or refresh the current page, you can only use
window.name = "__self";
window.open(window.location .href, "__self") //Note that two underscores
replace location.href

when you need to close the modal window of the Nth (N>1) layer and refresh the N-1th layer When using a modal page, in order to prevent a new window from popping up when refreshing, you can pass the return value to the N-1 layer modal window through returnValue to confirm whether it needs to be refreshed
In the submit event of the button:
code

Copy code The code is as follows:

Response.Write("");

Control the pop-up of the modal window in the N-1 layer modal window and Confirm whether you need to refresh the page
Code
Copy code The code is as follows:

< script type="text/javascript">
function OpenShowDialog(id) {
var isReflesh = window.showModalDialog('Test.aspx?id=' id, window, 'dialogWidth=670px;dialogHeight=250px; status:no;directories:yes;scrollbar:no;Resizable:no');
if (isReflesh == 1) {
window.name = "__self";
window.open(window.location .href, "__self")
}
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn