Why is JSON on IE input Chinese query results do not display, but in Firefox, Google can? How to fix it

Source: Internet
Author: User
Why does the JSON input Chinese query on IE not show the result, but in Firefox, Google can??
Why does the JSON input Chinese query on IE not show the result, but in Firefox, Google can??
Query is not a problem, because when you enter a number, the data is displayed, and the Chinese is the query to the data, debugging also see the data stored in the JSON, but the problem is I show on the page? Please help to solve the master, here first thank you!
Querying data via Json_encode () public function ajaxloadaction () {
$rsName = $this->verify_str ($this->_request->getparam (' rsname '));
$rsPhone = $this->verify_str ($this->_request->getparam (' Rsphone '));
$rsAddress = $this->verify_str ($this->_request->getparam (' rsaddress '));
$rsAge = $this->verify_str ($this->_request->getparam (' rsage '));

$responsibleModel =new Responsiblemodel ();
$srArray = $responsibleModel->getquery ($rsName, $rsPhone, $rsAddress, $rsAge);
Print_r ($srArray);//$srArray = $this->getalllist ($responsibleModel);
Print_r ($srArray);

echo Json_encode ($srArray);

}

Calling JSON on a page
$.getjson (URL, function (JSON) {
alert (json.length);
if (Json.length!=0) {
$ (tab_id). empty ();
$.each (Json,function (i,responsible) {
str + = " "+
""+responsible.responsible_name+""+
""+responsible.responsible_phone+""+
""+responsible.responsible_address+"";
});
$ (tab_id). append (str);
}else{
Alert ("No data you want to query!");
}
});

------Solution--------------------
Estimation is a problem with coding
------Solution--------------------
alert (json.length); Do you have a value?
alert (JSON); See what?
------Solution--------------------
Then you have to change to a lower version of IE to see
Maybe IE9 doesn't support your code.
------Solution--------------------
I've had this situation before. 、、、

There is no solution. ......


------Solution--------------------
HTML PHP is saved in UTF8 format ... Be careful not to have BOM
------Solution--------------------
The output of the string format problem, in JS converted to JSON format, or the Chinese encoding problem, with the "flag Chinese value.
  • 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.