简体   繁体   中英

alert and confirm boxes do not appear

I have a couple of webpages which i in part build up dynamically (php and JavaScript).

Everything used to work well in the past, but now the various calls to alert and confirm do not cause dialog boxes to appear anymore.

Using the JavaScript debugger in firefox i can verify, for example, that the statement

var r = confirm("Do you really want to save this data?");

is executed, but no dialog window is opened, and the code goes on as if i had pressed "no" (in this step the watch expression for r changes from "undefined" to "false").

The same happens for calls to alert - the code is executed, but no dialog window is shown.

I have not checked these pages in a while, which means there have been various software updates since then.

Strangely however, this seems not to be a browser-wide effect: a different set of similarly built pages does not show this behavior - there, the dialog boxes are shown.

Is it possible that there is some setting in JavaScript or php which prevents dialogs from opening?

Does anybody have an idea how to fix this problem?

I had the same problem before and my problem was solved with the following code. You try it too, maybe it will help you too.

let r = window.confirm("Do you really want to save this data?");

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM