Question about json_encode ()

Source: Internet
Author: User
Confusion about json_encode () This post was last written by u013037779 at 2014-12-0612: 07: 33. I wrote this in the controller and then output the Json format in a text file. However, the receiver always prompts a system error. Baidu said the encoding is incorrect, but I have written it at the beginning of the acceptor and the UFT-8 code is also specified in the sender controller. I am confused about json_encode ().

This post was last edited by u013037779 at 12:07:33

This is what I wrote in the controller.

Then I output the Json format in a text file;

However, the acceptor always prompts a system error. Baidu says the encoding is incorrect, but I already wrote it at the beginning of the acceptor.

The sender controller also specifies the UFT-8 encoding.
At present, the receiver cannot accept the data and says it is a system error ..

I used window. alert ("OK ");
It proves that the data is returned, but the error is in var t and the system error is always prompted ..
How can this problem be solved?
Can you provide the following code?
------ Solution ----------------------
Then I output the Json format in a text file. the Chinese language uses utf8 encoding. Add the following code in the front-end javascript code:

Data = eval ('+ data +'); // assume that the received content is stored in data.

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.