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