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);
}
});