我将 jquery ajax 与 $.confirm 结合使用,我需要弄清楚如何加载 codeigniter 控制器/方法以响应 $.confirm。这是代码:
$.ajax({
url: sURL + "utility/ajaxFind_In_tblClients",
type: "POST",
data: {ClientNum: ClientNum},
dataType: 'json',
success: function(json) {
$.confirm("The email address registered to this account is:\n\n"
+json.ClientEmail+
"\n\nSend password recovery information to this email address?"+
"\n\nIf you need assistance, please call 888-526-9999.",
//YES
function(){
//need to load a codeigniter controller here
$.msg("Password recovery information has been sent.\nPlease check your inbox",
{header:'Password Sent', live:10000});
$('#ajaxShield').hide();
},
//NO
function(){
$.msg("Password recovery information has NOT been sent.",
{header:'Password Not Sent', live:10000});
$('#ajaxShield').hide();
}
) //end of confirm
}, //end of success: function(json), could be YES or NO inside
error:function (xhr, ajaxOptions, thrownError){ alert('Problem with utility/ajaxFind_In_tblClients Status code:'+xhr.status+', Error:'+thrownError);}
});
看起来我在第 14 行需要帮助。在用户对 $.confirm 响应“是”后,我不知道如何加载 codeigniter 控制器。有任何想法吗?谢谢。