THE <SCRIPT> ELEMENT
The primary method of inserting JavaScript into an HTML page is via the <script>
element. This element was created by Netscape and first implemented in Netscape Navigator 2. It was later added to the formal HTML specification. There are six attributes for the <script>
element:
async
—Optional. Indicates that the script should begin downloading immediately but should not prevent other actions on the page such as downloading resources or waiting for other scripts to load. Valid only for external script files.charset
—Optional. The character set of the code specified using thesrc
attribute. This attribute is rarely used because most browsers don't honor its value.crossorigin
—Optional. Configures the CORS settings for the associated request; by default, CORS is not used at all.crossorigin="anonymous"
will configure the request for the file to not have the credentials flag set.crossorigin="use-credentials"...