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

defer='defer”和async='async”

Jul 07, 2017 pm 06:10 PM
async defer

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is async for es6 or es7? Is async for es6 or es7? Jan 29, 2023 pm 05:36 PM

async is es7. async and await are new additions to ES7 and are solutions for asynchronous operations; async/await can be said to be syntactic sugar for co modules and generator functions, solving js asynchronous code with clearer semantics. As the name suggests, async means "asynchronous". Async is used to declare that a function is asynchronous; there is a strict rule between async and await. Both cannot be separated from each other, and await can only be written in async functions.

How vue3+async-validator implements form validation How vue3+async-validator implements form validation May 11, 2023 am 09:55 AM

Building a vue3 project Before creating a project, the first thing we need to explain is that the version we use is Nodejs: v17.5.0pnpm: 7.0.0Vue: 3.2.25. First, we Vite creates a vue3 project demo named FormValidate. Enter the command pnpmcreateviteFormValidate on the command line and press Enter, then select vue and continue to press Enter, indicating that we have initially created the FormValidate (form validation) project. According to the command line prompts, we enter the project root directory, and then use the command pnpminstall to install the dependencies required for the project. Of course Using pnpm here is better than n

What is defer keyword in Go language? What is defer keyword in Go language? Jun 11, 2023 am 09:10 AM

What is the defer keyword in Go language? When writing programs, we often need to perform some cleanup or resource release work after a certain function or method is executed. At this time, the Go language provides a convenient mechanism. By using the defer keyword, these cleanup or resource release tasks can be postponed until the function or method returns. The defer keyword is a syntax sugar that is parsed at compile time. It defers the call of a function or method until the current function or method returns.

How to use Python async module How to use Python async module May 30, 2023 pm 11:43 PM

Coroutine: Coroutine, also known as micro-thread, is a context switching technology in user mode. In short, it is actually a thread to implement code blocks to switch between executions. Python's support for coroutines is implemented through generators. In the generator, we can not only iterate through the for loop, but also continuously call the next() function to obtain the next value returned by the yield statement. But Python's yield can not only return a value, it can also receive parameters sent by the caller. 1. What is a generator? In Python, this mechanism of looping and calculating at the same time is called a generator: gene

How to use async/await to handle asynchronous operations in Vue How to use async/await to handle asynchronous operations in Vue Jun 11, 2023 am 09:18 AM

How to use async/await to handle asynchronous operations in Vue With the continuous development of front-end development, we need to handle more complex asynchronous operations in Vue. Although Vue already provides many convenient ways to handle asynchronous operations, in some cases, we may need to use a simpler and more intuitive way to handle these asynchronous operations. At this time, async/await becomes a very good choice. What is async/await? In ES2017, async and

What exactly is going on with coroutines in Python? What exactly is going on with coroutines in Python? Apr 14, 2023 am 08:28 AM

1. The traditional Sync syntax request example is still the same. Before understanding the implementation of Async syntax, let's start with a Sync syntax example. Now suppose there is an HTTP request. This program will obtain the corresponding response content through this request and print it out. , the code is as follows: import socket def request(host: str) -> None: """Simulate the request and print the response body""" url: str = f"http://{host}" sock

What is the delayed execution statement in Go language What is the delayed execution statement in Go language Jan 11, 2023 pm 06:28 PM

In the Go language, the delayed execution statement is the defer statement, and the syntax is "defer any statement". The defer statement will delay processing of the statements that follow it. When the function to which the defer belongs is about to return, the delayed statements will be executed in the reverse order of defer; that is, the statement that is deferred first will be executed last, and the statement that is defer last will be executed. statement is executed first.

defer and panic of golang function defer and panic of golang function Apr 20, 2024 am 11:06 AM

The defer and panic keywords are used to control exceptions and post-processing: defer: push the function onto the stack and execute it after the function returns. It is often used to release resources. Panic: Throws an exception to interrupt program execution and is used to handle serious errors that cannot continue running. The difference: defer is only executed when the function returns normally, while panic is executed under any circumstances, even if an error occurs.

See all articles