Front | Back |
What goes into the script tag for defining an external javascript file
|
<script type="text/javascript" src="jsfile.js"></script>
|
What is the syntax for an "if" statement
|
If (something == 1) { // do something}
|
How do you tell the browser that you will be using JavaScript?
|
<script type="text/javascript">
|
How do you popup a message in a dialog window
|
Alert("This will show in a popup window")
|
How do you insert a value into an ID on an HTML Page
|
Two Parts<p id="ResultsP"></p> in Javascript document.getElementById('ResultsP').innerHTML='Hello World";
|
What at the java escape sequences
|
backspace; f formfeed;
new line;
carriage return; tab; ` single quote; " double quote; \ backslash; xNN hex number that identifies a character in the Latin-1 character set
|
What is invaid in the name of a variable
|
Reserved words, cannot start with a number, characters other than numbers, letters and underscore,
|
Differences with memory and objects
|
Two variables can reference the same object
|
Ways to increment a variable
|
MyVar= myVar + 1; myVar++; ++myVar
|
What is the difference between myVar++ and ++Myvar
|
If used in an expression such as myVar=myVar++ * 10 + 1; it multiplies first and then increments by 1 - so this would be 12; if you use myVar=++myVar * 10 + 1, it adds 1 to myVar first making the total 21
|