Skip to main content

Bug Tracker

Side navigation

#7248 closed enhancement (wontfix)

Opened October 19, 2010 07:03AM UTC

Closed April 16, 2011 08:48PM UTC

XHR response Blob support

Reported by: zealot0630@gmail.com Owned by:
Priority: low Milestone:
Component: ajax Version: 1.4.3
Keywords: needsreview,ajaxrewrite Cc:
Blocked by: Blocking:
Description

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.

Attachments (0)
Change History (6)

Changed October 19, 2010 07:18AM UTC by Zealot comment:1

patch

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" );

Changed October 19, 2010 06:33PM UTC by snover comment:2

keywords: → needsreview

Bikeshed/feature creep. Marking for review.

Changed October 24, 2010 04:55PM UTC by rwaldron comment:3

component: unfiledajax
priority: undecidedlow

Changed December 07, 2010 06:22AM UTC by paul.irish comment:4

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.

Changed December 27, 2010 10:37PM UTC by rwaldron comment:5

keywords: needsreviewneedsreview,ajaxrewrite

Changed April 16, 2011 08:48PM UTC by john comment:6

resolution: → wontfix
status: newclosed

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