Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome receiving HTML instead of JSON #10

Open
h2ooooooo opened this issue Jun 25, 2012 · 2 comments
Open

Chrome receiving HTML instead of JSON #10

h2ooooooo opened this issue Jun 25, 2012 · 2 comments

Comments

@h2ooooooo
Copy link

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

@pnm1231
Copy link

pnm1231 commented Jun 21, 2013

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

@acegank
Copy link

acegank commented Sep 4, 2020

chrome same too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants