Ajax请求无法执行显示错误消息

时间:2016-08-08 09:01:23

标签: javascript jquery ajax

我一直在使用$ .ajax方法调用API进行验证&随后处理请求。我试图调用它,但每次请求失败时都会失败:

Exception: [Exception... "The URI scheme corresponds to an unknown protocol handler"  nsresult: "0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)"  location: "JS frame :: http://localhost:90/project/assets/plugins/jquery/jquery.min.js :: .send :: line 5"  data: no]

我的代码示例如下:

    $('#signupProcess-form').on('click', function (e) {
       var dataObject = {firstName: $('#userFirstName').val(), lastName: $('#userLastName').val(), email: $('#userEmail').val(), password: $('#userPassword').val()};
                                    console.log(dataObject);

     $.ajax({
           url:'localhost:90/project/php/scripts/validation/signup/validation-signup.php',
            type: 'POST',
            data: dataObject,
            datatype: "json",
            success: function (data) {
            var response = $.parseJSON(data);
            if (response.statusCode == 200) {
                 submitSignupForm(dataObject);
               }
            },
            error: function (jqXHR, textStatus, errorThrown) {
            alert('Exception: ' + errorThrown);
            }
            });
    e.preventDefault();
   });

这里缺少什么或任何不起作用的过程。需要帮助

1 个答案:

答案 0 :(得分:0)

最好试试这个uri:'http://localhost .......'