jQuery.AjaxFileUpload.js
jQuery.AjaxFileUpload.js copied to clipboard
Chrome receiving HTML instead of JSON
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
Thanks for the solution! It was happening on Firefox as well...
chrome same too