Why does JSON input Chinese query results not show in IE, but under Firefox, Google can?
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 '));
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.
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.