Home  >  Article  >  Web Front-end  >  Jquery returns json data and prompts for download in IE browser_javascript skills

Jquery returns json data and prompts for download in IE browser_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:47:551224browse

Today I encountered a problem where Jquery returns json data, and IE browser prompts for downloading. After submitting the data, the data returned is originally json data. It is normal when tested in Fire Arc, but IE always prompts to save. I searched online. Most of them say that the ContentType is set to "text/xml". I tested it and the return value is undefined.

The original return value setting: context.Response.ContentType = "application/json";

Try: context.Response.ContentType = "text/xml;"; failed

Later tried: context.Response.ContentType = "text/plain;charset=UTF-8";

Success!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn