JAVASCRIPT Flashcards
Where does JavaScript run?
In the browser, no need for a development environment.
What is built-in the browser to run JavaScript code?
The JavaScript console.
How do you open the JavaScript console?
ctrl+shft+J
How do you clear the console?
by pressing the circular icon with the bar running through it.
What is a line of JavaScript code called?
A JavaScript statement.
How to bring up a pop-up box with a statement on it?
alert();
How to bring up the previous command on the console?
use the up arrow.
Code for a dialog-box with the words “hi” …
alert(“hi”);
Code to send a message to the console with the word “Hello” …
console.log(“Hello”);
Code to send the text “Hi” to the webpage you’re on …
document.write(“Hi”);
How do you to the next line in the console without entering your current line of code?
shft + return
Code to write an < H1 > with the text “Fuck You” to the current webpage you’re on …
document.write( “ < h1 > Fuck You < / h1 > “ );
How does code run?
line by line
Where do you place JavaScript code?
In a seperate file, but in the same folder of your html, much like a CSS file.
What executes JavaScript code?
The JavaScript engine built into the browser.
What extension do JavaScript files have?
.js
Where are JavaScript links usually placed in HTML files?
Just before the ending < body > tag.
Code for a link from an html file to a JavaScript file named script.js which is in a file named js …
< script src = “ js / script.js “ > < / script >
Can you link more than one JavaScript file in your html file?
YES, YES a thousand times YES, ALREADY!!!
Where are JavaScript errors logged?
In the JavaScript console.