1
jquery의 알림 플러그 인을 사용하지 않을 때 완벽하게 작동하는이 스크립트가 있습니다. 하지만 경고 플러그 인을 사용해야하고 튜토리얼에서 배운 후이를 구현했습니다. 그러나 스크립트가 작동하지 않는 것 같습니다.jquery alert plugin, jConfirm
<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>
무엇이 잘못 되었나요? 어떻게 작동하지 않습니까? –
경고로 알리지 않습니다. jConfirm 함수가 호출되지 않습니다. $ .ajax가 호출되기 전에 경고를 시도했지만 작동하지 않았습니다. – noobcode