如何在jquery中编写确认框代码

how to write the confirm box code in jquery?

本文关键字:确认 代码 jquery      更新时间:2023-09-26

如何在asp.net2.0中编写jquery,我根据要求点击按钮显示确认框

  • 确认框更改按钮(是、否(和图像(警告、信息等(以及标题请给我完整的代码,添加了哪些库,以及如何在asp.net2.0中编写函数
  • 还显示了基于条件的警告框更改图像和标题。

    1. 添加了哪些库以及如何编写函数

    功能:$("#confirm_button"(.点击(function(({

    jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
                                    jAlert('Confirmed: ' + r, 'Confirmation Results');
                                });
                            });
    

    我正在点击类似的按钮代码

**

> <input id="confirm_button"
> type="button" value="Show Confirm" />

**

请帮我

THNAK UHEMANTH

$(document).ready(function()
{
    $("#iId").click(function () 
    {
        if (confirm('Your confirm text?')) 
    {
            //confirm='true', (means if you click on ok)
        // your code will go hire
        }
        else
    {
        //confirm='false', (means if you click on cancle)
            // your code will go hire
    }
    });
});

注意:您必须在代码中保留jquery ui脚本文件

您应该查看jquery UI对话框:http://jqueryui.com/demos/dialog/

希望这能有所帮助。干杯