Bug Tracker

Ticket #7248 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 4 years ago

XHR response Blob support

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

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.

Change History

comment:1 Changed 4 years ago by Zealot

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

comment:2 Changed 4 years ago by snover

  • Keywords needsreview added

Bikeshed/feature creep. Marking for review.

comment:3 Changed 4 years ago by rwaldron

  • Priority changed from undecided to low
  • Component changed from unfiled to ajax

comment:4 Changed 4 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 4 years ago by rwaldron

  • Keywords needsreview,ajaxrewrite added; needsreview removed

comment:6 Changed 4 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix

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.