admin管理员组

文章数量:1305974

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?

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?

Share Improve this question edited May 31, 2018 at 10:23 TRiG 10.6k8 gold badges61 silver badges111 bronze badges asked Dec 3, 2015 at 10:07 anairanair 1161 gold badge1 silver badge5 bronze badges 8
  • 5 Do you have some kind of ad blocker installed on chrome. – Aneesh Mohan Commented Dec 3, 2015 at 10:08
  • I have adblock chrome extension installed. – anair Commented Dec 3, 2015 at 10:11
  • It might be blocking your confirmation. – Aneesh Mohan Commented Dec 3, 2015 at 10:12
  • Actually we had a bug last week. This confirmation was being thrown on every user actions (which was the side effect of another bug fix) – anair Commented Dec 3, 2015 at 10:13
  • 4 Any errors thrown? Does the popup just not show up, or does it not register the value correctly? Have you tried logging x and checking if you get correct output? Also, if you have an adblocker installed, you can probably make it log it's actions through the settings, so you can check if it goes wrong there. – FullyHumanProgrammer Commented Dec 3, 2015 at 10:21
 |  Show 3 more ments

1 Answer 1

Reset to default 6

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 plete restart of chrome

本文标签: JavaScript confirm not working in ChromeStack Overflow