JavaScript confirm not working in Chrome

你离开我真会死。 提交于 2019-11-28 05:01:19

问题


Below is a code snippet used in the legacy application I am currently working on.

var x=confirm("Some Text");
if(x)
 //Call method A
else 
// Call method B

It was working fine till some days ago, but now it is not working in Chrome, but still good in IE.

Would it be something to do with the browser update?


回答1:


Remove any ad blocker extension installed to your chrome and try again. Sometimes on applications which have large user base, a few users may mark pop up as ads. This will in turn block pop up/Confirm/Dialogue/Alert for all users who have that extension installed.

I had this problem once. Ad Block extension blacklisted alerts in my website.

NOTE: After removing extension, please close all instance of chrome. Requires a complete restart of chrome



来源:https://stackoverflow.com/questions/34063030/javascript-confirm-not-working-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!