JQuery Ajax Post:500内部服务器错误

时间:2013-01-30 09:05:30

标签: php jquery

我正在尝试执行此AJAX帖子但由于某种原因我收到服务器500错误。

   $.ajax({
            url: '.../PublicAPI.svc/Register',
    type: 'POST',
    dataType: 'json',
    async: false,
    //contentType: 'application/json; charset=utf-8',
    data: '{ "ApiKey": "'+$('#ApiKey').val()+'", "LanguageId": "'+$('#LanguageId').val()+'", "Password": "'+$('#Password').val()+'","Username": "'+$('#Email').val()+'" }',
    success: function( response, textStatus, jqXHR ) {
        console.log('success');
        console.log(response);
    },
    error: function( jqXHR, textStatus, errorThrown ) {
        console.log(jqXHR);
            console.log(textStatus);
        console.log(errorThrown);
    }
}); 

任何人都可以帮我找出问题所在吗?

1 个答案:

答案 0 :(得分:2)

您在AJAX网址中使用了三个点。尝试使用2个点,服务器错误应该消失。

url: '../PublicAPI.svc/Register',

请参阅Three or more dots followed by a slash in url causes an internal server error