异步= QUOT;异步" < script>的属性在html中标记,这是什么意思? [英] async="async" attribute of a <script> tag in html, What does it mean?
问题描述
这是什么意思?
async="async"
attribute of a <script>
tag in HTML, What does it mean?
<script async="async" src="...."></script>
Can be see used here for example
推荐答案
如果async属性设置在外部脚本(其中一个使用src =)时,支持它的浏览器将在后台下载该脚本,而不会阻塞页面上的其他内容。该脚本将在完成下载时执行。
If the async attribute is set on an external script (one with src=), browsers that support it will download that script in the background without blocking the rest of the content on the page. The script will execute whenever it is finished downloading.
http://dev.w3.org/html5/spec/Overview.html#attr-script-async
正如我在评论中提到的,设置async = true,async = false或async =任何东西都意味着同样的事情。他们启用异步行为。使脚本非异步的唯一方法是完全省略该属性。
As I mentioned in a comment, setting async=true, async=false or async=anything all mean the same thing. They enable the async behavior. The only way to make a script non-async is to completely omit the attribute.
http://dev.w3.org/html5/spec/Overview.html#boolean-attributes
这篇关于异步= QUOT;异步" < script>的属性在html中标记,这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!