Note 5 for Web Scripting

Watch & Read:

Functions
Syntax
Example
function name_of_function(variable)
{
Java_script_code
}
function sayhi()
{
alert("Hi Jon ")
}
For Loops
Syntax
Example
for (start; end; increment)
{
Java_script_code
}
for (i = 0; i <= 5; i++)
{
document.write("The number is " + i + "<br />")
}
While Loops
Syntax
Example

while (condition_end)
{
Java_script_code
increment

}

i = 0
while (i <= 5)
{
document.write("The number is " + i + "<br />");
i++;
}
Do While Loops
Syntax
Example

do
{
Java_script_code

increment
}

while (condition_end)

var i=0
do {
document.write("The number is " + i+ "<br />");
i=i+1;
}
while (i <= 5)

Terms you need to Lookup:

 

Review the following:

Event
What it does
onclick: JavaScript starts by clicking (a link, or form boxes)
onload: JavaScript starts after the page or an image has finished loading.
onmouseover: JavaScript starts by the mouse moving over a link
onmouseout: JavaScript starts by the mouse moving off the link
onunload: JavaScript starts after you leave the page.

Homework:

Reminder: Post on the Discussion Board Section at least one URL of a Web Page that uses a Web script and describe how the script works.

You should Read Chapters 5

Final Step:

Imagine that your mind is a DVD recorder / player and you can review this content anytime you want.  I want you to close your eyes and quickly review in your mind everything we covered in class. 

I also want you to review everything we covered before you go to bed because I want your mind to process this information while you sleep.  You don’t need to spend much time on this review, 5 minutes will be enough!