js attribute of the script tag

HTML <script>element is used to embed or reference an executable script.

An insert in html scripttag

<script src="index.js"  sync crossorigin="anonymous"></script>

Common attributes:

  • src Definition introduces an external scriptURL
  • typeDefined scriptelement contains or srcscripting language references, text/javascript, text/ecmascript, application/javascript, in html5, the property can be ignored, it is loaded by defaultJavaScript
  • Asynchronous execution of the script async case is in the browser allowed. Boolean value that defaults to true, in order to headhead the external load required to operate domthe script, you must specify the asyncproperty
  • deferThis Boolean attribute is set to inform the browser that the script will be resolved after the document is completed, the trigger DOMContentLoadedexecution before the event.
  • crossoriginCross-domain attribute, “anonymous"keyword description will not pass cookiesclient SSLcertificates or HTTPauthentication exchange user credentials.

Guess you like

Origin www.cnblogs.com/dobeco/p/11408287.html