The problem line is
var modRes = xml.getResponseHeader("Last-Modified");
Mozilla does not seem to allow reading the header detail we need.
I put one condition outside this line to execute it only ifModified flag is set. But I think the try...catch maybe a better idea.
-Ashutosh
On 8/29/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
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/
--
Reach1to1 Communications
http://www.reach1to1.com
[EMAIL PROTECTED]
98201-94408
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
