- // Set the correct header, if data is being sent
- if ( s.data )
- xml.setRequestHeader("Content-Type", s.contentType);
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data )
+ xhr.setRequestHeader("Content-Type", s.contentType);
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if (jQuery.lastModified[s.url])
+ xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
+ if (jQuery.etag[s.url])
+ xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+ }