A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/html/elements/script below:

script · WebPlatform Docs

script Summary

The script element enables dynamic script and data blocks to be included in documents. It can contain code/data directly or it can link to external sources. It is mainly used with JavaScript.

Overview Table
DOM Interface
HTMLScriptElement
Attributes Property Description Used with inline scripts src The URL to an external file that contains the source code or data. No type The MIME type for the script. Required in HTML 4, defaults to text/javascript in HTML 5. For JavaScript, this should always be set to application/javascript since RFC4329. Yes charset Sets or retrieves the script’s character encoding. You can’t use the type attribute with this attribute. No language The programming language for the associated scripting engine. Depracated, use type instead. Yes defer Specifies that script should be executed after the document has been parsed. No async Specifies that the script should be executed asynchronously, as soon as it becomes available. No crossorigin Whether or not script error information will be revealed from the script(This is used only when scripts are being loaded from different origins). No Examples

Loading an external script.

<script src="http://example.com/Script/Url/here.js" type="application/javascript"></script>

Writing an inline script.

<script type="application/javascript">
  
</script>
Notes

Code within the script block that is not contained within a function is executed immediately as the document is loaded.When the Type attribute is unset on the script object, then text/javascript is used. The order of the script objects in a document can also be important, especially if scripting event handlers are assigned to one or more elements in the document. Using async="async" didn’t work in some older browser, instead async="true" was used.

Related specifications
HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation
HTML 4.01
W3C Recommendation
See also Related articles HTML Other articles

<noscript> tag

Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4