1. Intro - Part A Flashcards
What is JS?
2x
Created to “make web pages come alive”
Programs are called “scripts”
How is JS code provided and executed?
3x
Can be written in a web page’s HTML
Runs automatically as page loads
As plain text - no special preparation or compilation needed to run
Where is JS code executed?
3x
Browser
Server
Any device that has JS engine
What is a JavaScript engine?
Special program for enabling JS to be executed
What is the JavaScript engine embedded in the browser sometimes called?
JavaScript virtual machine
Give codenames for commonly used browser engines
5 x
Chrome, Opera: V8 Firefox: SpiderMonkey IE: Trident, Chakra Edge: ChakraCore Safari: Nitro, SquirrelFish
Summarise how engines work
3x
- Reads (parses) the script
- Converts (compiles) the script to machine language
- Machine code runs at a fast speed
What takes place at each stage of engine’s process?
2x
Optimisations
Analyses data flowing through script to further optimise machine code
What can in-browser JS do?
3x
Everything to do with:
Webpage manipulation
Interaction with the user
Interaction with the webserver
Give examples of in-browser JS actions
5x
Add to / amend page content, modify styles
React to user actions: mouse clicks, pointer movements, key presses
Send requests over network to remote servers, download/upload files (AJAX & COMET technologies)
Get and set cookies, show messages and ask questions to the visitor
Remember data on client-side (local storage)