javascript - Why i get verify network error when ajax try post to server? -
in asp.net mvc try call controller action on server,for purpose write ajax code:
$('#enterbtn').click(function() { $.ajax({ url: '@url.action("uservalidation", "account")', type: 'post', data: { phonenumber: $('#phonenumber').val(), password:$('#password').val(), }, success: function () { var url = '@url.action("landingpage", "home", new { area = "" })'; window.location.href = url; }, error: function (jqxhr, exception) { var msg = ''; if (jqxhr.status === 0) { msg = 'not connect.\n verify network.'; } else if (jqxhr.status == 404) { msg = 'requested page not found. [404]'; } else if (jqxhr.status == 500) { msg = 'internal server error [500].'; } else if (exception === 'parsererror') { msg = 'requested json parse failed.'; } else if (exception === 'timeout') { msg = 'time out error.'; } else if (exception === 'abort') { msg = 'ajax request aborted.'; } else { msg = 'uncaught error.\n' + jqxhr.responsetext; } alert(jqxhr.status); alert(msg); } }); });
when debug ,get know controller call ,but ajax error:
verify network
what happen?how can solve that?thanks.
Comments
Post a Comment