diff options
author | jaubourg <j@ubourg.net> | 2012-03-07 15:39:39 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-03-07 15:39:39 +0100 |
commit | 484cea1b5651d215a24d3a6827663a4e16a6a253 (patch) | |
tree | 82e6de08b25eb70714f80e4f0dda299762897349 /src/ajax/xhr.js | |
parent | 014b2a57007c4fd2bc85397f83fe36eec88aa975 (diff) | |
download | jquery-484cea1b5651d215a24d3a6827663a4e16a6a253.tar.gz jquery-484cea1b5651d215a24d3a6827663a4e16a6a253.zip |
Fixes #11426: getting the responseText of an xhr should be tried/caught because of IE's inability to give access to binary data. Unit test added.
Diffstat (limited to 'src/ajax/xhr.js')
-rw-r--r-- | src/ajax/xhr.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index a87c32392..013863d4e 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -148,7 +148,13 @@ if ( jQuery.support.ajax ) { if ( xml && xml.documentElement /* #4958 */ ) { responses.xml = xml; } - responses.text = xhr.responseText; + + // When requesting binary data, IE6-9 will throw an exception + // on any attempt to access responseText (#11426) + try { + responses.text = xhr.responseText; + } catch( _ ) { + } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests |