All pastes #797999 Raw Edit

tre grimes

public text v1 · immutable
#797999 ·published 2007-11-26 14:16 UTC
rendered paste body
20 Questions
1 - What tag tells your browser that you are starting a javascript (syntax) ? <script type="text/javascript">
2 - Does javascript require the use of semicolons, and will it malfunction if you do use them (syntax) ? No it doesn’t require the use of  semicolons and it won’t malfunction.
3 - What are the 3 areas where you place javascripts (location) ? Inside the head  tag, body tag, and external tag.
4 - What is an event (location) ? Everyone someone clicks on a button.
5 - What is the file extension for a javascript file (external) ? .js
6 - What is an operator, and what are they most often used for (operators) ? A Symbol that is used to perform an operation.
7 - What is a variable's purpose (variables) ?  A Variable’s purpose is to store information that can be used later.
8 - What tag do you use before the variable’s name (variables) ? document.write
9 - How often do you need to use this tag (variables) ? Just the first time it is used.
10 - What are the rules of thumb with variable naming (variables) ? Start with a lowercase letter (a-z) and use underscores to separate a name with multiple words (i.e. my_var, strong_man, happy_coder, etc).
11 - What is a function (functions) ? A function is a piece of code that sits dormant until it is referenced or called upon to do its "function".
12 - What is code reusability (functions) ? Calling the function multiple times to get the same effect.
13 - Where do you place the function (functions) ? Between <!— and //-->.
14 - What do the curly braces do (functions) ? The curly braces "{,}" define the boundaries of our function code.
15 - What is an alert (functions) ? It’s a javascript popup.
16 - What are 5 examples of events (events) ? A mouse click, The web page loading, Mousing over a hot spot on the web page, also known as hovering, Selecting an input box in an HTML form and a keystroke.
17 - What is the event tag for a mouse-out (events) ?  <a href="#" onmouseover="" onMouseout="popup()"">
Hover Me!</a>

18 - What do statements define (statements) ? Statements define what the script will do and how it will be done.
19 - What typically ends the statement in a javascript (statements) ? </script>

20 - When would you use a conditional, loop, object manipulation, comment, and exception statement (statements) ? Conditional statements are used to control your scripts so that different actions can be taken depending on the situation. A loop statement checks to see if some condition is true, say our condition is "Are there any invitations left?" and if that condition is true it will execute a chunk of code. These are statements that are used to take advantage of the object model to get tasks done. Comment statements are used to prevent the browser from executing certain parts of code that you designate as non-code. The Exception statement tries to execute a piece of code and if it fails the catch should handle the error gracefully.