JavaScript的confirm弹出的是,否按钮,而不是确定和取消 [英] Javascript Confirm popup Yes, No button instead of OK and Cancel
问题描述
JavaScript的confirm弹出,我想说明是,否按钮而不是确定和取消。
Javascript Confirm popup, I want to show Yes, No button instead of OK and Cancel.
我已经使用这个VBScript中code:
I have used this vbscript code:
<script language="javascript">
function window.confirm(str) {
execScript('n = msgbox("' + str + '","4132")', "vbscript");
return (n == 6);
}
</script>
在IE这只工程,在FF和Chrome,这是行不通的。
this only works in IE, In FF and Chrome, it doesn't work.
有没有workround在Javascript实现这一目标?
Is there any workround to achieve this in Javascript?
我也想改变弹出窗口的标题就像在IE的Windows Internet浏览器显示,我想在这里展示我自己的应用程序名称。
I also want to change the title of popup like in IE 'Windows Internet Explorer' is shown, I want to show here my own application name.
推荐答案
不幸的是,没有打开一个确认对话框,是不是默认的确定/取消对跨浏览器的支持。您所提供的解决方案使用VBScript中,这是唯一可用的IE浏览器。
Unfortunately, there is no cross-browser support for opening a confirmation dialog that is not the default OK/Cancel pair. The solution you provided uses VBScript, which is only available in IE.
我会建议使用,可以构建一个基于DOM的对话,而不是一个JavaScript库。尝试jQuery用户界面: http://jqueryui.com/
I would suggest using a Javascript library that can build a DOM-based dialog instead. Try Jquery UI: http://jqueryui.com/
这篇关于JavaScript的confirm弹出的是,否按钮,而不是确定和取消的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!