The database uses UTF-8, the existing system uses gb2312,
uses <script>echo_script(url);</script>
<script> <br>function echo_script(url){ <br><br>var USERAGENT = navigator.userAgent.toLowerCase() ; <br>var bname = ''; <br>var b = ['ie','msie','firefox','chrome','opera','safari','maxthon','mozilla',' webkit']; <br>for(i in b){ <br>if(USERAGENT.indexOf(b[i]) > -1){ <br>bname = b[i]; <br>break; <br>} <br>} <br>if(!bname)bname='other'; <br>var ie8 = USERAGENT.indexOf('msie 8') > -1 ? 'ie8' : false; <br> var ie7 = USERAGENT.indexOf('msie 7') > -1 ? 'ie7' : false; <br><br>if(bname == 'firefox' || ie8 ) <br>{ <br>var enc = "no"; <br>} <br>if(ie8){ <br>bname = 'ie8'; <br>}else if(ie7){ <br>bname = 'ie7'; <br>} <br><br>var tmp_ie8 = ie8 ? 'ie8' : 'no_ie8'; <br><br>document.write("<script src='" url "&encode=" enc "&browser=" tmp_ie8 "&browserv= " bname "'></script>");
}
Hey, this method leads to constant garbled characters under different browsers , it hurts me.
There is an easier way
Garbled codes will no longer appear!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn