我得到了这个脚本,当我不使用jquery的alert插件时,它工作得很完美。但我需要使用alert插件,在从教程中学习之后,我实现了它。但脚本似乎不起作用。
<script type = "text/javascript">
$(document).ready(function() {
var pos = $("tr.verify").attr('id');
var frmId = $('#'+ pos).find("form").attr('id');
$('#'+ frmId).click(function(event) {
jConfirm('Are you sure you want to verify?', 'Confirmation Dialog',
function(r) {
if(r==true)
{
$.ajax({
type: "POST",
url: "verify.php",
data: $("form#" + frmId).serialize(),
success: function(msg){
if(msg.indexOf("success") > -1)
{
//success in registaration
var inputsub = $("form#" + frmId).find('input[type=submit]').attr('id');
$('#' + inputsub).val('verified').attr('disabled','disabled');
} //end of if
else if(msg.indexOf("Error") > -1)
{
alert(msg);
} //end of else if
} // end of success event
}); //end of ajax code
} // end of if r == true
return false;
}); //the alert code
}); //end of form submit
}); //Main document ready code
</script>发布于 2010-01-13 20:27:33
感谢zakalwe的回复。我找出了问题所在..阅读文档后,我发现我使用的是旧版本的jQuery viz 1.2.2,而该插件需要1.2.6或更高版本。这是一个愚蠢的错误,花了我3个小时。无论如何,值得注意的是of..thanks
https://stackoverflow.com/questions/2056306
复制相似问题