将javascript确认对话框更改为引导 [英] Changing javascript confirm dialog box to bootstrap

查看:42
本文介绍了将javascript确认对话框更改为引导的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有这个东西

这是原始代码:

<script type='text/javascript'>
function delete_user( id ){

    var answer = confirm('Are you sure?');

    //if user clicked ok
    if ( answer ){
        //redirect to url with action as delete and id to the record to be deleted
        window.location = 'delete.php?id=' + id;
    }
}
</script>

如何删除旧的JavaScript确认对话框并用引导程序替换?

How do I remove the old javascript confirm dialog box and replace it with bootstrap?

推荐答案

方法 confirm(显示模式确认对话框)与Mozilla Firefox使用的XPInstall API关联。自Gecko 1.9起不推荐使用此方法,并且很可能无法通过引导程序配置。可以在以下位置找到参考:
https://developer.mozilla.org/zh-CN/docs/Archive/Mozilla/XPInstall/Reference/Install_Object/Methods/confirm https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XPInstall

The method 'confirm', which shows a modal confirmation dialog box, is associated with the XPInstall API that was used by Mozilla Firefox. This method has been deprecated since Gecko 1.9 and most likely will not be configurable by bootstrap. References can be seen at: https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XPInstall/Reference/Install_Object/Methods/confirm and https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XPInstall

这篇关于将javascript确认对话框更改为引导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆