On ASP. NET pages, you often need to link some JS files, such:
< Script Language = " Javascript " SRC = " /AA. JS/ " > </ Script >
If there is a Chinese character in JS, an error is reported in the browser.
If you do not believe it, try it yourself.
This is actually the case:
In a project automatically generated by vs. net, there is such a section in Web. config:
globalization
Requestencoding = "UTF-8"
Responseencoding = "UTF-8"
/>
It defines that the stream sent and received by the application is encoded in UTF-8.
However, the problem lies here, because we all use the Chinese version of Windows, the Chinese version of. therefore, the default encoding for saving files is gb2313, so when ASP. when the JS file is sent to the client, an Encoding Error occurs, resulting in an incorrect script being sent.CodeTo the client.
The solution is simple. Change the encoding definition in Web. config to gb2312.