簡體   English   中英

用戶單擊文件上傳中的關閉按鈕后,如何關閉窗口?

[英]How do I close a window after the user clicks on the close button in file upload?

當用戶單擊文件上傳中的“取消”按鈕時,我們需要關閉彈出窗口本身。

  1. main.html
  2. popup.html

popup.html包含<input type="file"

現在我們有一個要求,當用戶單擊文件上傳窗口中的“取消”按鈕時,也應該關閉popup.html

<!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();" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM