简体   繁体   English

为什么我的网站出现JQuery AJAX错误,并且没有响应头?

[英]Why does my website have a JQuery AJAX error , and there are no response headers?

When I click on "Request and Invite", you'll notice that there's a JQuery error...but it's weird. 当我单击“请求并邀请”时,您会注意到存在一个JQuery错误...但这很奇怪。

http://bit.ly/cuq5KV http://bit.ly/cuq5KV

The code is pretty simple. 代码很简单。 The error seems to be happening on JQuery's file. 该错误似乎发生在JQuery的文件上。 I tried previous versions of JQuery (both compressed and uncompressed), but there were always problems. 我尝试了早期版本的JQuery(压缩和未压缩),但始终存在问题。

Make sure you return false from the form submit handler or the ajax call won't have time to execute: 确保您从表单提交处理程序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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM