notes from 2015
Javascript
is an object-oriented computer programming language commonly used to create interactive effects within web browers.
e.g.
document.write(“Hello from Javascript”);
Variable
is a storage location paired with an associated symbolic name (an identifier), which contains some known or unknown quatity of information referred to as a value.
is a stored piece of information (stored data) that can be changed.
- Named Container for Storing Values
- Can be set to anything
- Declared using the var keyword
P.S.
must start your variable with letters or “_”
== is exact comparison
!== not the same
=== is strict comparison
Datatype
is a piece of data with predefined characteristics.
Q: On what datatype in Javascript can calculations be done?
A: The “number” datatype. [p.s. integer does not exist in javascript]
Modifying HTML Content
Q: What property of the full mark up of an element is used to get its contents?
A: The “.innerHTML” property
- document.getElementsByTagName(‘p’);
- document.getElementById(‘par2’); from <p id=”par2″>paragragh2</p>
e.g.
document.getElementById(‘par2’).innerHTML = “Loading Amendments…”
Functions
Funtion
(or method) is a prewritten set of instructions that may or may not return a value.
Q: What keyword is used in Javascript to designate the creation of a function?
A: The “function” keyword.
- Block of code designed to perform a particular task
- Only runs when called
- Declared using the function keyword
e.g.
“Javascript Widgets”
• What is a Server?
• Web Hosting Services
• Introduction to XAMPP
• Putting Content Online
Programming Fundamentals
• Getting our web application to “think”
• Conditional logic, loops, and arrays
– Deductive Reasoning:
Q: If a card has a vowel on one side, it must have an even number on the other side
A. K. 2. 7.
A: Should be A and 7. (May be adding K as well, as you want to make sure the other side of K is not an even number.)
Which card(s) must be turned over to determine whether or not the rule has been followed?
Conditional Statement: is a if-then statement in which a hypothesis is followed by a conclusion.
The ‘if’ Statement
- Found in every piece of software
- Found in every web application
- Simplest and most popular method to create conditional statements in programming
- Checks if the condition, or hypothesis, is met
- Executes some code, or conclusion
The ‘else’ Statement
• Used at the end of an ‘if’statement
• Executes code when the ‘if’condition is not met

Array
Array is a special variable in Javascript (and other programming languages) that can hold multiple values at the same time.
From:
Loop
For Loop

// for( i = 0; i
for( i = 0; i
“);
“);
“)
While
