Commit 56a93fc2 authored by John Resig's avatar John Resig

Added an extra try block to handle FF 3 x-domain requests. (Bug #1557)

parent 14a3a5bf
...@@ -255,6 +255,8 @@ jQuery.extend({ ...@@ -255,6 +255,8 @@ jQuery.extend({
// Open the socket // Open the socket
xml.open(s.type, s.url, s.async); xml.open(s.type, s.url, s.async);
// Need an extra try/catch for cross domain requests in Firefox 3
try {
// Set the correct header, if data is being sent // Set the correct header, if data is being sent
if ( s.data ) if ( s.data )
xml.setRequestHeader("Content-Type", s.contentType); xml.setRequestHeader("Content-Type", s.contentType);
...@@ -266,6 +268,7 @@ jQuery.extend({ ...@@ -266,6 +268,7 @@ jQuery.extend({
// Set header so the called script knows that it's an XMLHttpRequest // Set header so the called script knows that it's an XMLHttpRequest
xml.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
} catch(e){}
// Allow custom headers/mimetypes // Allow custom headers/mimetypes
if ( s.beforeSend ) if ( s.beforeSend )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment