Chapter 5 Flashcards
To learn Chapter 5 concepts
What is the event handler for vanilla JavaScript?
addEventListener
What is a touch event?
Any action taken by an application when a gesture is applied
What does ‘ontouchstart’ do?
It is an event that will trigger when someone is using a touch screen and touches the screen to start
What does API stand for?
Application Programming Interface
Now, define what API is
An API is a set of routines, protocols, and tools that we use to build apps. Specifically for programming graphical user interface elements otherwise known as GUI elements.
What is a Web Worker?
These are APIs that allows scripts to run background in parallel; they connect to multiple webpages to get real-time data. From Mozilla Developers network:
Web Workers makes it possible to run a script operation in a background thread separate from the main execution thread of a web application. The advantage of this is that laborious processing can be performed in a separate thread, allowing the main (usually the UI) thread to run without being blocked/slowed down.
What is a Web Socket?
An API with consistent communication between a client and a web server.
What is full-duplex communication?
It’s an old networking term that means two devices connected to a network can communicate back and forth at the same time
Geolocation API
an interface that uses latitude and longitude coordinates to provide a devices’ location
What is a try-catch sequence?
Try to do something, if it doesn’t work we’ll catch an error message and if we do catch an error message we want something else to happen
What are the main events associated with WebSocket communcations
onopen: when a socket opens
onmessage: when the web server receives a message
onclose: when a socket closes
File API
Used for uploading files from local storage to remote server
Web Storage
Saves session data within the browser or device memory. The sessionStorage() method keeps data until the browser is closed (for one session) localStorage() saves large data persistently (session-to-session).
Local storage
Used to save persistent data. It is stored in key/value pairs. It is browser-specific
Hardware capabilities
GPS
Accelerometer
Camera