我使用jQuery 1.7.1。 与沿阿贾克斯形式的插件 ,最新版本。 当我做一个Ajax请求,如:
$('form').ajaxForm (
{
success: function ( data )
{
alert ( data.responseText );
},
error: function ( data, status, error )
{
alert ( data.getResponseHeader('Content-type') );
}
}
);
如果该请求返回一个错误,IE(IE9,在我的情况)将始终为Content-type头或任何其他头与此有关的返回未定义。 该data.responseText属性也将返回null。 这不是壁虎或WebKit浏览器的情况下。
这些是Ajax请求被返回的响应报头的示例:
Response HTTP/1.1 400 Bad Request
Date Fri, 18 May 2012 08:15:32 GMT
Server Apache/2.2.14 (Ubuntu)
X-Powered-By PHP/5.3.2-1ubuntu4.15
Expires Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma no-cache
Connection close
Content-Type text/html
如何规避IE中的这一行为的任何想法?