晚上好,
我用不同的语法尝试了很长时间,但没有成功:一切都在 PhoneGap 上运行。我得到了console_log
before $.ajax..
,但之后没有任何错误或输出。单击“提交”后,将执行此 JS 代码:
console.log(in_mail + " " + in_text);
$.ajax({
type: 'POST',
data: "mail="+in_mail+'&text='+in_text,
url: 'http://example.com/comment.php',
success: function(data){
console.log(data);
alert('Your comment was successfully added');
},
error: function(){
console.log(data);
alert('There was an error adding your comment');
}
});
console.log("POST done");