In IE, ajaxreturn is used to return JSON data to indicate a download error.

Source: Internet
Author: User
Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn about thinkphp. The new version sets the ajaxreturn method. If it is in JSON format, the header information is automatically set to JSON format, in this way, Google can parse the file normally, but a download prompt will be prompted in IE and operabrowser, resulting in a program error. The modification method is as follows:
The new version of thinkphp sets the ajaxreturn method. If it is in JSON format, the header information is automatically set to JSON format. In this way, it can be parsed by Google. However, the Browser IE and operawill prompt the download, as a result, a program error occurs. The modification method is as follows:
Open: ThinkPHP/Lib/Core/Action. class. php
Code found: Header ('content-Type: application/json; charset = UTF-8 ');To: Header ('content-Type: text/html; charset = UTF-8 ');There are two parts in total.
In addition, we recommend that you do not do this. All text/html browsers are supported, while application/json only supports new browsers, which may cause a lot of unnecessary troubles. [compatibility is very important].

QQ20130528152452.png (21.83 KB download: 180 times)

AD: truly free, domain name + VM + enterprise mailbox = 0 RMB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.