当前位置:网站首页>Attributes of script tag

Attributes of script tag

2022-06-10 16:54:00 Peach root Fairy

<script type language async src defer charset crossorigin integrity></script>

async: Indicates that you should start downloading scripts immediately , But it can't stop other page actions ;
type
language: abandoned . Originally used to represent scripting languages in code blocks ( Such as "JavaScript"、"JavaScript 1.2" or "VBScript"). Most browsers ignore this property , It should no longer be used .
src
defer: Scripts can be delayed until the document is fully parsed and displayed , Only valid for external script files .
charset: Specifies the code character set
crossorigin: Configure cross site resource sharing settings , Parameter options :anonymous The configuration file does not have to set the credential flag ;use-credentials Set the credential flag
integrity: Optional . Allows comparison between received resources and specified encrypted signatures to verify the integrity of subresources (SRI,Subresource Integrity). If the signature of the received resource does not match the signature specified by this attribute , The page will report an error , Scripts don't execute . This property can be used to ensure that the content distribution network (CDN,Content Delivery Network) Will not provide malicious content .
 

原网站

版权声明
本文为[Peach root Fairy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101557499624.html