From 3289a91a848ea803b12ecb23412f33e09128ff2b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 16 Mar 2012 10:53:28 -0400 Subject: [PATCH] handle when browser returns json in a
 (yeah, srsly)

---
 vendor/assets/javascripts/ajaxfileupload.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vendor/assets/javascripts/ajaxfileupload.js b/vendor/assets/javascripts/ajaxfileupload.js
index e72fad3..1d09cbc 100644
--- a/vendor/assets/javascripts/ajaxfileupload.js
+++ b/vendor/assets/javascripts/ajaxfileupload.js
@@ -100,6 +100,12 @@ jQuery.extend({
                     if ( status != "error" )
 					{
                         // process the data (runs the xml through httpData regardless of callback)
+                        if ($('pre', xml.responseText)) {
+                          var $doc = $("
").append(xml.responseText); + + xml = { responseText: $doc.find('pre').get(0).innerHTML}; + } + var data = jQuery.uploadHttpData( xml, s.dataType ); // If a local callback was specified, fire it and pass it the data if ( s.success )