javascript 在确认()对话框中是/否按钮而不是确定/取消?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15447358/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Yes/No buttons instead of OK/Cancel in a confirm() dialog?
提问by Danny Beckett
In an Adobe AIR (HTML/JS) app, is it possible to display Yes/Nobuttons, instead of OK/Cancelin a confirm()
dialog?
在 Adobe AIR (HTML/JS) 应用程序中,是否可以在对话框中显示Yes/No按钮而不是OK/ ?Cancelconfirm()
Anything that works with webkitshould work.
任何适用于webkit 的东西都应该可以工作。
Here's a related question, but all of the answers utilise jQuery, which I don't want to add just for this.
这是一个相关的问题,但所有答案都使用 jQuery,我不想为此添加。
采纳答案by paxdiablo
I don't believe so. In JS, confirm()
is specified to only use the OKand Cancelbuttons.
我不相信。在 JS 中,confirm()
被指定只使用OK和Cancel按钮。
If you want something more complicated, you'll have to make your own dialog, or use a third-party one that provides your desired functionality (yes, including jQuery, unfortunately).
如果您想要更复杂的东西,则必须制作自己的对话框,或者使用提供所需功能的第三方对话框(是的,不幸的是,包括 jQuery)。
回答by SteveP
It's not possible to customise the confirm()
dialog.
无法自定义confirm()
对话框。
There are some suggestions at Javascript Customize Confirm with "Yes" or "No"but it pins down to using jQuery or implementing your own version of the jQuery dialog.
在Javascript Customize Confirm with "Yes" 或 "No" 上有一些建议,但它固定到使用 jQuery 或实现你自己版本的 jQuery 对话框。