Charset attribute usage of script tags _ basic knowledge
Source: Internet
Author: User
If the character encoding in an external file is different from that in the main file, the charset attribute is used.
Definition and usage The charset attribute specifies the character encoding used in an external script file.
If the character encoding in an external file is different from that in the main file, the charset attribute is used.
The default character encoding is the ISO-8859-1.
Src and charset attributes For a particularly long JavaScript program or a program that is often used repeatedly, you can store the code in a separate file. In this case, let the browser load the individual file through the src attribute.
The src value is the URL of the file containing the JavaScript program. The MIME type of the saved file should be application/x-javascript. However, if the file name is suffixed with. js, it can be properly processed by the server correctly configured.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.