ASP MVC Ajax状态为200但解析器错误

时间:2018-06-25 18:56:49

标签: jquery ajax asp.net-mvc

我吓坏了...我有一个运行正常的项目(实际上,在主机上运行中),但是本地所有Ajax请求都返回状态200,但出现parsererror错误。奇怪的是,在responseText中,我得到了正确的响应,但最后带有注释:

<-142,6021ms-> 那是什么??

Response

这是我的要求:

            $.ajax({
                url: '/Usuarios/Authenticate',
                type: "POST",
                data: { username: $('input[name=username]').val(), password: $('input[name=password]').val() },
                dataType: "json",
                async: true,
                cache: false,
                success: function (msg) {
                    if (msg.Success) location.href = '/';
                    else {
                        ShowError(msg.Message);
                    }

                    CloseLoading();
                },
                error: function (data, ajaxOptions, thrownError) {
                    console.log(data);
                    ShowError(ERR_UNKNOWN);
                    CloseLoading();
                }
            });

我正在使用Windows 10 x64的Visual Studio 2017 Pro。上次访问后我什么都没碰。我刚刚打开了该项目,右键单击并在Chrome中查看。

谢谢!

1 个答案:

答案 0 :(得分:0)

我只记得我将其添加到了web.config文件中

<modules runAllManagedModulesForAllRequests="true">
   <add name="TimingModule" type="[...]" />
</modules>

这会在响应中添加评论...

相关问题