We have a requirement to close the popup window itself when the user clicks on the cancel button in the file upload.
popup.html
contains <input type="file"
.
Now we have a requirement that when a user clicks on the cancel button in the file upload window popup.html
should also be closed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="javascript">
function openModalDlg() {
window.open( "test.html", "", 'width=400,height=100');
}
</script>
</head>
<body>
<p>
Click
<a href="#" onclick="openModalDlg();">here</a>
to open modal dialog
</p>
</body>
</html>
您可以使用window.close方法:
<input type="button" value="Close" onclick="window.close();" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.