![](/img/trans.png)
[英]Why does my jQuery Ajax GET-request not receive a response from the server?
[英]Why does my website have a JQuery AJAX error , and there are no response headers?
當我單擊“請求並邀請”時,您會注意到存在一個JQuery錯誤...但這很奇怪。
代碼很簡單。 該錯誤似乎發生在JQuery的文件上。 我嘗試了早期版本的JQuery(壓縮和未壓縮),但始終存在問題。
確保您從表單提交處理程序return false
,否則ajax調用將沒有時間執行:
$('#waitlist_form').submit(function() {
var the_email = $('#waitlist_box').val();
$.ajax({
type: 'POST',
url: '/waitlist/submit',
data: { email: the_email },
beforeSend: function() {
},
success: function(html) {
$('#waitlist_button').html('Thanks!');
}
});
return false;
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.