JavaScript in HTML

This chapter discusses the script element, tag placement and deprecated syntax, compares inline and external scripts, examines how document modes affect JavaScript and prepares the reader for JavaScript‐disabled experiences. The introduction of JavaScript into web pages immediately ran into the Web&...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Zakas, Nicholas C
Format: Buchkapitel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:This chapter discusses the script element, tag placement and deprecated syntax, compares inline and external scripts, examines how document modes affect JavaScript and prepares the reader for JavaScript‐disabled experiences. The introduction of JavaScript into web pages immediately ran into the Web's predominant language, HTML. JavaScript is inserted into HTML pages using the script element. The code contained within a script element must be completely interpreted before code in the next script element can begin so long as defer and async attributes are not used. For nondeferred scripts, the browser must complete interpretation of the code inside a script element before it can continue rendering the rest of the page. Asynchronous scripts are not guaranteed to execute in the order in which they occur in the page. By using the noscript element, one can specify that content is to be shown only if scripting support is not available on the browser.
DOI:10.1002/9781118722176.ch2