I am executing the following jquery ajax call to an asp.net mvc controller which works, however on the firebug console it seems it is getting executed three times. The first two times it returns 401 Unauthorized and the final time it return 200 Ok. Could anyone shed some light on what is happening when I make this request and how I could stop the inital calls from failing.
$.ajax({
type: 'POST',
url: '/Core/GetVariableSet',
dataType: 'json',
data: {},
success: function(response) {
thisObject.Date = new Date(response.Date);
thisObject.UserId = response.UserId;
thisObject.UserName = response.UserName;
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
Util.errorhandling.AJAXError($('#main'),
'Error Getting Variables',
XMLHttpRequest,
textStatus,
errorThrown);
}
});
I noticed this was happening to me when I was debugging in firefox. The fix I found was to add the site to the 'network.automatic-ntlm-auth.trusted-uris' list in firefoxs about:config.
Be sure to include the port if it's the local development server causing problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With