JSON compatibility Issue with Internet Explorer 9
Fetching JSON data is working fine in Google Chrome but in Internet Explorer 9, the brows开发者_如何学Goer shows this instead:
Do you want to open or save the file?
How do I correct this?
Does the server set a Content-Type
-header? Ex.
Content-Type: application/json
The browser usually knows that application/json
(like text/html
etc.) isn't for download, but for the browser itself.
If you don't set it, the broser may think it's just a plain text file and offer it as a download to the user.
精彩评论