Fichas
Web Programming
Fichas del conjunto (22)
- 1Where does webpage JavaScript get executed?JavaScript that is served with a webpage is executed in the client
- 2How do you connect a JavaScript file to an HTML page?Use a script tag.
Example: - 3When does webpage JavaScript get executed when you use 'module'?After HTML parsing (deferred execution)
- 4When does webpage JavaScript get executed when you don't use 'module'?When the script tag is encountered during HTML parsing
- 5What does the DOM stand for?Document Object Model
- 6What is the DOM?It is a tree structure with same hierarchy as the HTML it is generated from, and it's composed of nodes which represent HTML elements.
- 7The DOM is programmatic representation of an HTML document (and associated stylesheets)True
- 8How does the browser use the DOM?It is the canonical representation of a webpage and its styling and it is what the browser renders to the user.
- 9Why is the DOM useful to us a.f.a JS is concerned?We can edit the DOM via JS code (and this is much easier than editing an HTML/CSS document itself)
- 10What is an event (in JS)?It is an object that represents the idea that a thing has happened
- 11How do events propogate through the DOM?Upward/Outward
- 12Do events propogate automatically by default?Yes
- 13What is an event listener?Punction that has been designed to respond to events (of some type) that occur on a particular DOM
- 14How many types of events and how many nodes can one function be designed as an event lister for?/////
- 15What is the purpose of events and event listeners? What do they enable?Asynchronous programming
- 16How can you tell which DOM node caused/experieced the event originally?event.target
- 17What is event delegation?A strategy for event handling where a single event listener is added to a parent node, but the intention of that listener is to handle the events that occur on the children.
- 18What are the differences between 'var', 'let', 'const', and no specifier?'const': cannot be reassigned (good and {} scoped)
'let': can be reassigned (good and {} scoped)
'var': function scoped (bad) get's hoisted
no specifier: global (bad) global - 19How do you obtain a reference to an element using JS?document.querySelector () or document.querySelectorAll()
- 20How do you change an element's style with JS?Obtain a reference to the element (elem) and then:
element.style.someCssProperty = value
where someCssPropert (JS) == some-css-property (CSS) - 21How do you add a function to an element as an event listener?elem.addEventListener('eventType', func)
- 22What browser API is used to make web requests from JS code?The fetch API
Información
- Descripción
- Fichas sobre Web Programming , creado por kristine mae el 01/11/2018.
- Creado por
- kristine mae
- Visitas
- 0
- Valoración