HTML5 the definition and stipulation of each label: script

Source: Internet
Author: User
Tags script tag

The script tag is used to define client script, such as JavaScript.
In addition to the global properties, there are the following properties

SRC defines the URL to the file that contains the script (so that you can refer to a file that contains the script instead of inserting the script directly into your HTML document)
Async defines whether the script executes asynchronously.
Defer indicates that the script will not generate any document content. The browser can continue to parse and draw the page.
Type Specifies the MIME type default Text/javascript
CharSet defines the character encoding used in the script.

If the Async property is true, the script executes asynchronously relative to the rest of the document, so the script executes in the process of the page continuing parsing.
If the Async property is false and the defer property is true, the script executes after the page finishes parsing.
If both the async and defer properties are false, the script executes immediately, and the page continues parsing after the script has finished executing.
Tip: If the src attribute exists, the &script& label must be empty.

Dom interface

Interface Htmlscriptelement:htmlelement {
           attribute domstring src;
           attribute Boolean async;
           attribute Boolean defer;
           attribute domstring type;
           attribute domstring charset;
           attribute domstring text;
};

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.