Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 18:41:03
Original
1018 people have browsed it

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")
}
}

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template