Hi,

the IfModified mode for Ajax calls may break Firefox 1.0. The following 
code:

var modRes = xml.getResponseHeader("Last-Modified");
if ( ifModified && modRes ) jQuery.lastModified[url] = modRes;

breaks and throws such an exception if such response header is not set:

Error: [Exception... "Component returned failure code: 0x80040111 
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.getResponseHeader]" 
nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: 
http://192.168.1.199/js/jquery.js :: anonymous :: line 5029"  data: no]
Source File: http://192.168.1.199/js/jquery.js
Line: 5029

The only way I could fix this is to wrap that code into a try/catch block:

try {
     var modRes = xml.getResponseHeader("Last-Modified");
     if ( ifModified && modRes ) jQuery.lastModified[url] = modRes;
} catch (e) {
     // do nothing
}


Or is it better practice to have such header always in any response?


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to