自定义JavaScript确认对话框? [英] Customizing JavaScript confirmation dialog boxes?

查看:105
本文介绍了自定义JavaScript确认对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$('#confirm_event').click(function(e){
    var x = $('#function_name').val();
    return confirm('Are you sure you want to submit: ')
})

< img src =https://i.stack.imgur.com/EyiDo.pngalt =在此处输入图像说明>

虽然这会产生上述情况,我想替换标题栏文本并在返回确认消息中包含var x值。我尝试了几种方法,但返回未定义的值或根本不起作用。如何自定义对话框?

While this generates the above, I'd like to replace "title bar text" and include var x value in the return confirm message. I tried several ways but returns undefined value or doesn't work at all. How do I customize the dialog box?

推荐答案

您无法更改默认对话框的标题。转到任何 Jquery Ui对话框插件。

You cannot change the default dialog's title. Go for any Jquery Ui dialog plugin.

或者其他一些第三方对话插件。

Or some other third party dialog plugins.

更喜欢阅读:在JavaScript中更改confirm()的默认标题?

我更喜欢使用Jquery Ui对话框:)

I prefer to use Jquery Ui dialog :)

这篇关于自定义JavaScript确认对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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