0
문제가 발생했습니다. 성공 후 내 기능이 리디렉션되지 않습니다. 리디렉션이없는 이유는 무엇입니까 ... if ... href after e.preventDefault(); 때때로 작동합니다.성공 후 URL로 Ajax 리디렉션
$('#nadwozie').change(function (e) {
if (window.confirm('Czy na pewno chcesz zmienić nadwozie/grafikę pojazdu ?')) {
var url = "raport_zapisanie_danepojazdu.php"; // the script where you handle the form input.
$.ajax({
type: "POST",
url: url,
data: $("#FormRaport").serialize(), // serializes the form's elements.
dataType: "text",
success: function (data) {
window.location.href = "raport.php?id=" + <?php echo $raport[0]['id'];?> +"&nadwozie=" + $(this).val();
},
error: function (request, status, error) {
//alert(request.responseText + status + error);
}
})
;
e.preventDefault(); // avoid to execute the actual submit of the form.
} else {
$("#nadwozie").val(previous);
previous = $(this).val();
}
});
어쩌면 오류 처리기가 실행 중입니까? 나는 당신이'raport_zapisanie_danepojazdu.php'에 제출하는 정규 옛날 형식 대신에 왜 ajax를 사용하는지 모르겠다. 그러면 서버 측을'raport.php'로 재전송 할 수있다. – James