WordPress를 통해 성공적인 AJAX 응답을 사용하여 양식을 작성했습니다. 필드는 비록 빈 데이터베이스입니다!AJAX에 대한 양식 값 일련 번호
// JavaScript Document
jQuery(document).ready(function($){
jQuery('#newFeedbackForm').submit(function(){
var topic = $('#topic').val();
var name = $('#name').val();
var email = $('#email').val();
var no_results_feedback = $('#no_results_feedback').val();
var post_data = {
action: 'addFeedback',
topic: topic,
name: name,
email: email,
no_results_feedback: no_results_feedback
};
$.post(av_feedback_vars.ajaxurl, post_data, function(response){
if(response == 'success'){
$('#feedback').text('Thank you for your comment.');
}else{
alert(av_feedback_vars.error_message);
}
});
return false;
});
});
어떻게이 경우 직렬화 사용하는 것이 : 나는 내 값을 직렬화하고 있지 않다 그것 때문에 같은데요? 멍청한 놈에게 도움을 주셔서 감사합니다 (여기 아약스에서 처음)
'alert (post_data)'비어 있는지 확인하십시오. – Norse
'[object Object]'를 인쇄 할 것입니다 ... 유용하지 않습니다. – Rudie