Home > Web Front-end > JS Tutorial > defer='defer”和async='async”

defer='defer”和async='async”

PHP中文网
Release: 2017-07-07 18:10:37
Original
1048 people have browsed it

Download immediately, but delay execution. i.e. the script will be executed when the page has finished parsing.

Note: The defer attribute only applies to external scripts, that is, when using the src attribute.

Download immediately and execute asynchronously. There is no guarantee that they will be executed in the order in which they are specified.

Note: The defer attribute only applies to external scripts, that is, when using the src attribute.

The async attribute is new in HTML5.


If neither async nor defer is used: the script is read and executed immediately before the browser continues to parse the page.

The above is the detailed content of defer='defer”和async='async”. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template