Week 5 Flashcards
When JavaScript manipulates a page or responds to user actions, what is it called?
Event Handling
JavaScript can…
Dynamically update _______ (CKE)
Manipulate ____ and ___
Manipulate and validate ____
Content, HTML and CSS, Data
As a developer
JavaScript cannot…
Write data permanently to an existing file
Access files on the server
Get data from the server database
Handle file uploads
JavaScript was introduced by NetScape in ____
JavaScripts biggest update was in 2015 when ___ was released, the ___ version
1996, ES6, 6th
Is JavaScript interpreted or compiled?
Interpreted
JavaScript’s key construct is the ________
function
3 ways to add JavaScript to an HTML page. Which way is recommended?
Embed, Inline, Link
Link is recommended
T/F - To embed a script with JavaScript, just add the code as part of a script element
True
To link a JavaScript file, just like a CSS file, where does the link go?
In the HTML pages head
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<button> Click Me! </button>
</body>
</html>
Will myFunction() link to the JavaScript function?
Yes
How do comments in JavaScript compare to Java?
They are identical
alert()
Display content with a pop up box
prompt()
DIsplays a message and an input field within a modal window
confirm()
Displays a question in a modal window with ok and cancel buttons
console.log
Display content in the browsers JavaScript console
document.write()
outputs the content (as markup or code) directly to the HTML document
What does markup mean?
Markup is the series of characters, symbols, and language that organizes and defines how the content looks, It is the code.
T/F - Each browsers console tab includes a text that you can use to enter your expressions or statements
True
T/F - You can execute multiple statements in the console by separating each statement with a semicolon
True
3 ways JavaScript code executes:
- Auto, when the page loads
- When your script calls a function
- In response to some event, such as the user clicking a button
JavaScript variables are dynamically _____, declared with the ___ or ___ keyword and are ____ _________
typed, let or var keyword, case senstiive
What does typeof do in JavaScript?
Figures out a given variables type
What is the default value and type of a declared but uninitialized varaible?
Undefined and undefined.
Do we use camelCasing for JavaScript?
yes