Teachers Name peter.thomas@vu.edu.au |
Lesson three |
|
Resources and Downloads | ||
Course Outline | ||
back to front | Lesson Three |
Lesson for today |
|||
1 |
Check Uni Student Email Account -- Contact me on peter.thomas@vu.edu.au | ||
2 |
The Blog ListIn today's lesson we will learn more of JavaScript and of Scripting. As part of your Assessment Blog you will create a 3 page sampler of all you have learned over the last 2 lessons .
|
||
3 |
AnnotationsTo make it easier to understand scripts after they are written programers ( that's you) use notation to expalin what the script does inside the script. It looks like this /* */ The wriiting inside the marks are hidden from the browser. It does not read them , but you can.
|
||
4 |
Work for today. Open Up Note Pad .
More JavaScripts |
||
5 |
Global Variables
I asked you to make up a three page htm site that showed off some of the skills you are learning. If you want to set variables that are used by a number of functions in your page then define them outside ( above the function ) Copy and paste this example. <html> |
||
6 |
Lets do some maths* is the multiplication sign / is division + and - should be obvious.
put this function into a page ( you will need to add plenty) function main()
Change the values Change the Question. |
||
7 |
Parsing NumbersNotice that the numbers do not use " " marks , that is because the program will read them as numbers not as strings. When you want the user to input numbers you are faced with a problem. To over come this the program needs to convert the numbers written from text strings to real digits. Put this in a script to see var number; |
||
8 |
If then else and Boolean LogicTry this function main() { var jasonsAge; jasonsAge=prompt("How old is Jason?","21"); if(jasonsAge>louisesAge) { document.write( "Jason is older than Lousie"); } document.write("I dont know any more than that"); }
|
||
9 |
Modify The ScriptNow modify the script so that if Jason is younger it writes something different. function main() { var jasonsAge; jasonsAge=prompt("How old is Jason?","21"); if(jasonsAge>louisesAge) { document.write( "Jason is older than Lousie"); } else { document.write( " Jason is NOT older "); } document.write("I dont know any more than that"); } |
||
10 |
Roll Overs. If then statements can also be useful for roll overs . First open Paint and create a red ball and a blue ball, save them as gifs in a folder called RollOver in My Documents. Now open a note pad file and write <html> |
||
11 |
More tags <body background="name of a GIF"> |
||
12 |
Migrating to Front page and Arachnophilia NB You need to use the html tab and remove what is there and replace your own. |
||
Resources and Downloads |
||
Script Sites |
Design |
Downloads |
Web Teacher |
On-Line shareware textbook Task Centered User Interface Design |
A tool to use in place of FrontPage Arachnophilia |
On
Using HTML |
Web
Style Guides |
|
A Forms Tutorial | ||
A primer on Using HTML from the NCSA |