Home > front end >  100 points to solve the AJAX ($.get) access to the page in IE the Chinese characters appear garbled
100 points to solve the AJAX ($.get) access to the page in IE the Chinese characters appear garbled

Time:12-11

To solve the real-time updating data to the front, the za section found an old JiuTie:
https://bbs.csdn.net/topics/330226012

In this post number123456 brothers give solution is as follows:

<script SRC="https://libs.baidu.com/jquery/1.11.3/jquery.min.js" & gt; </script>
 


<script language="javascript" & gt;
The function of the get () {
$.get (" server. Asp,} {action: list the function (data) {
$(" # List "). The HTML (data);
})
}
The set m=setInterval (" the get () ", 1000);//1 seconds, request a
</script>



Server. The asp
 
The Response. The Buffer=True
The Response. ExpiresAbsolute=Now () - 1
The Response. The Expires=0
Response. CacheControl="no - cache"
Response. AddHeader "Pragma", "No - Cache"

'your query SQL statements,



I debugging, didn't get the result, so write directly to the above code to do the following changes:
 
<script language="javascript" & gt;
The get ();//added program calls
The function of the get () {
$.get (" BBS. Asp, "{action:" # List "}, function (data) {//the original List into "# List
"$(" # List "). The HTML (data);
})
}
SetInterval (" the get () ", 5000);//5 seconds, request a
</script>



Server. The asp code correctly,

Test can get proper result,



the new question is: under the page in IE man words appear garbled, no problem under the Google browser,
(I now all the asp page encoding is GB2312), the diagram below:

IE Chinese characters appear garbled


Google browser under normal

On the Internet to find some methods, test not solve the problems one by one,
Excuse me, how to solve?

CodePudding user response:

<% @ LANGUAGE="VBSCRIPT" CODEPAGE="936" % & gt;
<%
The Response. The Charset="gb2312"
The Response. The CodePage="936"
The Session. The CodePage="936"
% & gt;

Head with the server. The asp

CodePudding user response:

Chinese garbled, change the page encoding to utf-8, don't know how to change the page ASP page code words to baidu, baidu on a lot of

CodePudding user response:

reference 1st floor qq_63572063 response:
& lt; % @ LANGUAGE="VBSCRIPT" CODEPAGE="936" % & gt;
<%
The Response. The Charset="gb2312"
The Response. The CodePage="936"
The Session. The CodePage="936"
% & gt;

Server. The asp head with these


The test or the code!

CodePudding user response:

refer to the second floor can't white reply:
Chinese garbled, change the page encoding to utf-8, don't know how to change the page ASP page code words to baidu, baidu on a pile of



I know this, also is the final solution as a last resort, but quantity is huge, want to ask you mean, look have to conservative treatment,
Thank you!

CodePudding user response:

Should not, under the mandatory refresh the browser to try again, CTRL + F5

CodePudding user response:

reference 5 floor qq_63572063 reply:
should not be, forced to refresh the browser to try again, CTRL + F5


Thank you! Or not, not restart the server,

When I enter the database of GB2312 encoding ASP page, the page is then stored in the database is GB2312 encoding in Chinese?

Has examined the data say AJAX $. When taken out of the get is utf-8, in GB2312 page will all Chinese is garbled (the current web page is showing GB2312 encoding),

So I don't know if you have about $. Get output utf-8 directly into GB2312 encoding?

CodePudding user response:

Actually a web site, two kinds of coding can coexist, you can just put the server. The asp, instead utf encoding

CodePudding user response:

refer to 7th floor qq_63572063 response:
is a web site, two kinds of coding can coexist, you can just put the server. The asp, instead utf encoding


Ok, I try to see

CodePudding user response:

In the head section of the page with the following
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;

CodePudding user response:

references 9 f Squall001 response:
in the head section of the page with the following
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;


All kinds of test, the feeling is committed to the database using GB2312 page before also GB2312 encoding of data, or out after the coding,
For example, I let the rendered page & lt; Meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt; , then $. Get out of database data or gibberish, already some normal Chinese characters on a page; Replacing manual coding for IE GB2312 is normal, but already some Chinese characters are rendered page programming the garbled, everything... %... RMB $$xx % % % %

CodePudding user response:

references to the tenth floor haohao7118 response:
Quote: references 9 f Squall001 response:

In the head section of the page with the following
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;


All kinds of test, the feeling is committed to the database using GB2312 page before also GB2312 encoding of data, or out after the coding,
For example, I let the rendered page & lt; Meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt; , then $. Get out of database data or gibberish, already some normal Chinese characters on a page; Replacing manual coding for IE GB2312 is normal, but already some Chinese characters are rendered page programming the garbled, everything... %... RMB $$xx % % % %

Only IE will appear this kind of problem?

CodePudding user response:

The original poster can distribute database, let me try, when the time comes to me ~ ~ ~

CodePudding user response:

Good lovely, why didn't Google browser? Generally speaking, IE faster, more stable, but Microsoft's browser product line some long, several browser products compete, than to Microsoft technical support department to send a bug report,

CodePudding user response:

1. The client POST simplified Chinese garbled.
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • ASP
  • Related