jQuery: The Write Less, Do More JavaScript Library

Ticket #165 (closed bug: invalid)

Opened 2 years ago

Last modified 1 year ago

Last-Modified and Firefox 1.0

Reported by: klaus.hartl@… Assigned to: anonymous
Type: bug Priority: blocker
Milestone: Component: ajax
Version: Keywords: John
Cc: John Needs:

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;

Attachments

Change History

Changed 2 years ago by joern

  • status changed from new to closed
  • resolution set to fixed

Fixed in SVN (swallowing the exception).

Changed 2 years ago by anonymous

  • priority set to blocker
  • status changed from reopened to closed
  • component set to ajax
  • resolution set to invalid
  • type set to bug

SPAMPOLICE

Changed 2 years ago by John

  • cc changed from "" to John
  • 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 changed from response header to John
  • type changed from bug to 1

Changed 2 years ago by anonymous

  • priority set to blocker
  • status changed from reopened to closed
  • component set to ajax
  • resolution set to invalid
  • type set to bug

SPAMPOLICE

Changed 2 years ago by john

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