Why is the query results of json input in Chinese under ie not displayed, but can be found at Firefox or Google?
Source: Internet
Author: User
Why is the result of inputting Chinese characters in json on ie not displayed, but on Firefox and Google ?? Why is the result of inputting Chinese characters in json on ie not displayed, but on Firefox and Google ?? Query is okay, because when a number is entered, data is displayed, while data is queried in Chinese. After debugging, the data is saved in json & nbsp, but the question is, why is the result of inputting Chinese characters in json on ie not displayed on the page, but on Firefox and Google ??
Why is the result of inputting Chinese characters in json on ie not displayed, but on Firefox and Google ??
Query is okay, because data is displayed when a number is entered, while data is queried in Chinese, and data is saved in json after debugging, but the problem is that I am displayed on the page? Please help us solve this problem. thank you!
Query data through 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 '));
Call json
$. 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 about encoding
------ Solution --------------------
Alert (json. length); is there a value?
Alert (json); what do you see?
------ Solution --------------------
Change the version of IE to a later version.
Maybe IE9 does not support your code
------ Solution --------------------
I used to have this situation. ,,,
No solution .......
------ Solution --------------------
Html php is saved in utf8 format... Do not include bom
------ Solution --------------------
The output string format is converted to json format in js or Chinese encoding. ''is used to mark the 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.