다음 코드를 성공적으로 실행하지만 성공 함수를 통해 불만을 구현하려고합니다. 인스턴트 메시지 만 보여 주지만, 다음 jquery 메시지 호출은 나타나지 않습니다. (메시지 기능은 동일한 페이지의 다른 인스턴스에서 작동 함).Jquery Ajax 게시 성공/오류 함수
jquery 1.6 사용.
코드가 실행되지 않는 이유는 무엇입니까? 감사! 내가 #postride
생각
$(document).ready(function(){
$('#postride').submit(function() {
dataString = $("#postride").serialize();
$.ajax({
type: "post",
url: "postride.php",
data:dataString,
error: function() {
alert('error!');
$(".message").text('An error occurred');
$(".message").fadeIn("slow");
$(".message").delay(2000).fadeOut(1000);
},
success: function() {
alert('success!');
$(".message").text('Your post has been completed');
$(".message").fadeIn("slow");
$(".message").delay(2000).fadeOut(1000);
setTimeout(function() { top.location.href="view.php" }, 3000);
}
})
});
});
완벽하게 작동했습니다. 고맙습니다!! – Matt