Bug Tracker

Opened 12 years ago

Closed 12 years ago

#7248 closed enhancement (wontfix)

XHR response Blob support

Reported by: [email protected] Owned by:
Priority: low Milestone:
Component: ajax Version: 1.4.3
Keywords: needsreview, ajaxrewrite Cc:
Blocked by: Blocking:


Currently only text and XML is supported in jQuery, but XHR2 introduced a new blob response (http://www.w3.org/TR/XMLHttpRequest2/#the-responseblob-attribute). I think it is worth considering.

Change History (6)

comment:1 Changed 12 years ago by Zealot


diff --git a/jquery-1.4.2.js b/jquery-1.4.2.js
index 0c8b750..c7124b3 100644
--- a/jquery-1.4.2.js
+++ b/jquery-1.4.2.js
@@ -5346,7 +5346,7 @@ jQuery.extend({
 	httpData: function( xhr, type, s ) {
 		var ct = xhr.getResponseHeader("content-type") || "",
 			xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
-			data = xml ? xhr.responseXML : xhr.responseText;
+			data = type === "blob" ? { type: ct, blob: xhr.responseBlob } : xml ? xhr.responseXML : xhr.responseText;
 		if ( xml && data.documentElement.nodeName === "parsererror" ) {
 			jQuery.error( "parsererror" );

comment:2 Changed 12 years ago by snover

Keywords: needsreview added

Bikeshed/feature creep. Marking for review.

comment:3 Changed 12 years ago by Rick Waldron

Component: unfiledajax
Priority: undecidedlow

comment:4 Changed 12 years ago by paul.irish

There are a lot of things in XHR2 that would be useful. Probably good for a whole plugin to dump all sorts of usefulness onto $.ajax.

comment:5 Changed 12 years ago by Rick Waldron

Keywords: ajaxrewrite added

comment:6 Changed 12 years ago by john

Resolution: wontfix
Status: newclosed

Yeah, let's push this off to a plugin (since Ajax is extensible now) - and we can reintegrate it later.

Note: See TracTickets for help on using tickets.