How to create TRULY modal alerts/confirms in Javascript?

后端 未结 2 1095
别那么骄傲
别那么骄傲 2021-01-24 05:15

I am sifting through prompt() and confirm() replacements for JavaScript. I need to create a couple of confirm()s and alert()s that have three or more o

2条回答
  •  礼貌的吻别
    2021-01-24 05:39

    Most JavaScript frameworks that have UI components have some kind of dialog that will provide callbacks. Check out jQuery UI, for example: http://jqueryui.com/demos/dialog/

    I've used it in multiple projects to do exactly what you're describing.

    Edit: I was hoping to suggest a workaround. Unfortunately JavaScript does not include methods to override and add additional buttons or options to the default browser-based Alert(), Confirm(), or Prompt() dialogs.

提交回复
热议问题