Home
Web Front-end
JS Tutorial
Solution to the encoding caused by dynamically creating scripts when caching js files in IE_javascript tips



Solution to the encoding caused by dynamically creating scripts when caching js files in IE_javascript tips
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 :
< body>
<script> <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></script>