Detect if an alert or confirm is displayed on a page

前端 未结 6 1779
傲寒
傲寒 2020-11-29 06:34

Is there a way using JavaScript or jQuery to detect if a confirm or alert box is being displayed?

6条回答
  •  温柔的废话
    2020-11-29 07:13

    Confirm and alert boxes are blocking events - Javascript code execution is halted while these are displayed. So no - you can not detect if one is currently being displayed, as far as I know.

提交回复
热议问题