簡體   English   中英

在輸入類型文件上添加JavaScript警報可防止打開文件對話框出現在Internet Explorer中

[英]Adding a JavaScript alert on the input type file prevents the open file dialog from appearing in Internet Explorer

我有一個輸入類型,=“ file”。 當我嘗試放置onclick = "alert('test')"; ,它同時顯示在Internet Explorer和Firefox中,但是在Internet Explorer中,按“確定”按鈕后,該消息將消失,並且在Firefox中什么也沒有發生:消息消失后​​,打開的文件對話框照常顯示。 JavaScript消息消失后​​,如何在Internet Explorer中顯示打開文件對話框?

至於Internet Explorer,我正在使用Internet Explorer 9

嘗試向該行添加返回值...

onclick="alert('test');return true;"

暫無
暫無

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

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