jQuery.AjaxFileUpload.js icon indicating copy to clipboard operation
jQuery.AjaxFileUpload.js copied to clipboard

Chrome receiving HTML instead of JSON

Open h2ooooooo opened this issue 12 years ago • 2 comments

I don't know if this is a problem with every browser, or just my chrome (19.0.1084.56 m), but I receive a "pre" element in the response when trying to use this plugin.

More specifically, this is what I receive in the 'response' parameter: <pre style="word-wrap: break-word; white-space: pre-wrap;">{"success":"success","imports":4,"errors":0}</pre>

This might or might not be due to a plugin, but is still an error per se.

I fixed this by changing the line var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;

to var response, responseStr = $(loadedFrame).contents().text();

I can also see that your default onStart, onComplete and onCancel functions use console.log. Beware that this means that the javascript (should) fail in older browsers. http://stackoverflow.com/questions/690251/what-happened-to-console-log-in-ie8

h2ooooooo avatar Jun 25 '12 16:06 h2ooooooo

Thanks for the solution! It was happening on Firefox as well...

pnm1231 avatar Jun 21 '13 16:06 pnm1231

chrome same too

acegank avatar Sep 04 '20 11:09 acegank