Karteikarten
2. JavaScript in HTML
Karten in diesem Stapel (15)
- 1The elementThe primary method of inserting JS into an HTML page
- 2What are the most used attributes of ?async
defer
src
type - 3Which attributes of are deprecated?charset
language - 4asyncThe script should begin downloading immediately but should not prevent other actions on the page. Valid only for external script files.
- 5deferThe script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded. Valid only for external script files.
- 6typeIndicates the type of script represented:
- omitted or JS MIME type
- module
- any other value - 7How do you include inline JS code?function sayHi() {
alert("Hi!");
}
<script> - 8How do you include external JS code?
- 9How are elements interpreted?In the order in which they appear in the page so long as the defer and async attributes are not present.
- 10When is a deffered script executed?After the browser has received the closing html tag.
- 11When is an async script executed?Before the page's load event and before or after DOMContentLoaded.
- 12What are the 3 advantages of using external files vs inline code?Maintainablity
Caching
Future-proof - 13Quirks modeWhen doctype is missing at the beginning of the document. Bad practice!
- 14elementThe content inside will be displayed only if the browser doesn't support scripting or the scripting support is turned off.
- 15Why is it a good practice to place elements towards the end of the page?The browser must complete interpretation of the code inside, before it can continue rendering the rest of the page. Exception: defer and async
Informationen
- Beschreibung
- JavaScript Karteikarten am 2. JavaScript in HTML, erstellt von Ioana Cosmina am 23/01/2020.
- Erstellt von
- Ioana Cosmina
- Aufrufe
- 1
- Bewertung