ajax xmlHttpRequest is undefined
Hi
I'm having a problem getting the error status when a session expires on the server
when i receive an http status of 401 the
error function alert returns xmlHttpRequest = undefined , textStatus = "error" & errorThrown = undefined
how do i get the status of 401 returned to my application
ajaxError & statusCode don't seem to work as well
what am i missing
my ajax code is as follows
jQuery.ajax ( {
type: 'POST',
dataType: "html",
contentType: "application/x-www-form-urlencoded; charset=utf-8",
url: url,
async: false,
data: {
'objid' : '101'
},
success: function(msg)
{
alert ( 'Success' );
},
error: function ( XMLHttpRequest, textStatus, errorThrown )
{
alert ( 'Error :' + XMLHttpRequest + ':' + textStatus + ':' + errorThrown );
}
}
);
the data comming back from the server is
HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
Content-Type: application/json;charset=UTF-8
Content-Length: 18
Date: Thu, 17 Mar 2011 21:26:38 GMT
"Session Expired."