开发者

Are there any additional parameters that can be passed to the Javascript native confirm / alert methods?

开发者 https://www.devze.com 2023-03-20 07:55 出处:网络
Are there any additional parameters besides the message accepted by the alert / confirm native JavaScript methods?

Are there any additional parameters besides the message accepted by the alert / confirm native JavaScript methods?

Specifically I would like to highligh开发者_运维百科t the cancel button rather than the ok.


If you need to do this, the way to get what you want is to concoct your own dialogs.

I'm not sure why any site design that takes itself seriously would ever use the built-in dialogs in the absence of some evidence that web users recognize some semantic content from those things (which I seriously doubt).

Oh, and the basic way to do this is to populate a <div> with your dialog content; position it absolutely (or whatever, depending on your overall situation); and show it in front of a div that covers the whole page with partial opacity or something so that the dialog is "modal" (with respect to your own page). Various libraries provide ways to do that, some more fancy than others. The point is that since it's your own dialog, you can style anything you like.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号