Bug Tracker

Ticket #165 (closed bug: invalid)

Opened 8 years ago

Last modified 7 years ago

Last-Modified and Firefox 1.0

Reported by: klaus.hartl@… Owned by:
Priority: undecided Milestone:
Component: ajax Version:
Keywords: John Cc: John
Blocking: Blocked by:

Description

If the response header "Last-Modified" is not available, the following code breaks Firefox 1.0:

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

It throws the following exception:

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

Fixed this with an try/catch block:

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

Change History

comment:1 Changed 8 years ago by joern

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in SVN (swallowing the exception).

comment:2 Changed 8 years ago by anonymous

  • Priority set to blocker
  • Resolution set to invalid
  • Status changed from reopened to closed
  • Component set to ajax
  • Type set to bug

SPAMPOLICE

comment:3 Changed 8 years ago by John

  • Cc John added; "" removed
  • Component changed from ajax to 1
  • Summary changed from Unavailable response header breaks Firefox 1.0 to John
  • Priority changed from blocker to 1
  • Version set to 1
  • Milestone set to 1
  • Keywords John added; response header removed
  • Type changed from bug to 1

comment:4 Changed 8 years ago by anonymous

  • Priority set to blocker
  • Resolution set to invalid
  • Status changed from reopened to closed
  • Component set to ajax
  • Type set to bug

SPAMPOLICE

comment:5 Changed 8 years ago by john

  • Summary changed from John to Last-Modified and Firefox 1.0
Note: See TracTickets for help on using tickets.