Let’s first look at the reproduction code 1, gb2312.html. The file is encoded as gb2312 Copy the code The code is as follows : <br>p { <br>color: red; <br>} <br> < body> test <br>function loadJS(src, charset ) { <br>var script = document.createElement('script'); <br>script.src = src; <br>script.charset = charset; <br>var head = document.getElementsByTagName('head')[ 0]; <br>head.appendChild(script); <br>} <br>