Inside mentioned "Dom is the UTF-8 of the code, if the JS library is not separate JS file, but included in the DOM, this problem will not appear." However, the separate JS file is not UTF-8 encoding, is Gacou into the UTF-8 encoded DOM, the Chinese appear garbled, and affect the quotation marks, so that the browser can not judge the end of the string. Solve the political reform is very simple, JS file Save as UTF-8 encoding format can be. ”
So I modified the JavaScript reference, <script type= "Text/javascript" src= "**.js" charset= "gb2312" ></script>
After the modification, sure enough, can be normal and correct operation. It seems to be really a problem with the Chinese coding format.
Problem: Although using gb2312 can solve the problem. But UTF-8 can not. Further research is needed.
The project did not perform well under the IE6 and made me sweat. If it were not for someone to use IE7, I am afraid I could not even get a big beer. It was a bluff, but the problem had to be solved. You know IE6 is still the primary browser. When I came back, I used IE6 to double-check the error JS Library on the remote server with the prompt "string constants not ended". I'm wondering if I'm not going to miss a quote, even if I forget to quote the string in quotes, the same goes wrong with IE7 and Firefox. Why is it so good? Find the wrong line after the truth ...
I need an event to process the user click button, set the item alert information to read, so that the alert information box no longer pops. jquery invokes the processing script and returns processing information. If the processing information is true, the setting is successful. The JS code specifies the information element in the DOM to modify the HTML, which is to set "unread" to "read".
Copy Code code as follows:
function Setread (ID) {
$.post ("result/setread.asp", {id:id},function (msg) {
if (msg==true) {
$ ("#msgList_" +id). HTML ("read");//Error line.
}
});
}
The problem is on this "read". Chinese, depressed for a long time. Dom is the UTF-8 of the code, if the JS library is not separate JS file, but included in the DOM, this problem will not appear. However, the separate JS file is not UTF-8 encoding, is Gacou into the UTF-8 encoded DOM, the Chinese appear garbled, and affect the quotation marks, so that the browser can not judge the end of the string. Solve the political reform is very simple, JS file Save as UTF-8 encoding format can be.
This little problem almost made me a big embarrassment in front of the eyes.