How to set charset=“utf-8” in the javascript file itself

前端 未结 2 774
你的背包
你的背包 2021-01-04 07:50

I am trying to set charset=\"utf-8\" inside the javascript file itself, not in the script tag, I know that I can do this:



        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-04 08:34

    I found another way, so instead of declaring charset="UTF-8" for the script tag like this:

    
    

    I can declare the charset for the web page itself using meta tag, so I can append to the DOM dynamically, and end up with something like:

    
    ...
      
    ...
    
    

提交回复
热议问题