ajax, json 및 PHP로 제출 양식 작업. 데이터는 DB에서 제대로 처리되지만 alert (data.success)와 함께이 스크립트는 data.success가 정의되지 않았다고 말합니다. 내가 (데이터) 경고하면, 내가 필요한 것을 보여줍니다 것은 {"success":"http:\/\/myaddress.com"}
data.success undefined
function confirmSubmit() {
$.ajax({
type: 'POST',
url: 'index.php?route=payment/authorize/send',
data: $('#authorize :input'),
beforeSend: function() {
var img = '<?php echo $text_wait; ?>';
$('#authorize_button').attr('disabled', 'disabled');
$('#authorize').before('<div class="wait"><img src="catalog/view/theme/default/image/loading_1.gif" alt="" /> ' + img + '</div>');
alert('Start');
},
success: function(data) {
if (data.error) {
alert('errors...');
alert(data.error);
$('#authorize_button').attr('disabled', '');
}
$('.wait').remove();
if (data.success) {
alert('success! It should redirect.');
location = data.success;
}
else {
alert('it worked... but won\'t redirect...');
alert(data.success);
}
}
});
alert('End');
}
오 치즈 n 크래커 ..... 고마워요, 어떻게 그걸 무시 했나요? – Robbie
@Robbie : Btw. 당신이 이미 몇 가지 질문을 봤는데 (꽤 오래 전부터;)), 아무 대답도받지 못했습니다. 그들 중 누구도 당신을 도왔습니까? 옆에있는 눈금 개요를 클릭하면 가장 유용한 답을 수락해야합니다. –
오 ... 고마워, 나는 자주 여기에 그것을 깨닫기에 충분하지 않다. – Robbie