Lecture notes - March 31
- Rest of term
- Final project
- A collection of linked web pages on a topic of your choice
- Illustrate ideas from this term: images, navigation, tables,
lists, style sheets, JavaScript,...
- Include a page describing what ideas you used, and what
tools you used to create the pages.
- JavaScript programming - more weekly assignments
- An elaborate JavaScript example: Mastermind
(requires Mozilla 1.3; Explorer 6.0 I think)
html |
javascript
- Review JavaScript so far
- <script language='JavaScript'> ... </script>
- var height=prompt("How high is it?", "")
- document.write("The height is " + height);
- This week: conditionals and objects
- boolean expressions
- true/false as at data type
- comparison operators : == , <= , >= , > , < , != ...
- negation: !
- and: &&
- or: ||
- if (boolean){
statement;
statement;
}
else {
statement;
statement;
}
- go over examples in class from text
- For next Tuesday:
- read chapters 11 ("if" and boolean expressions) and 12 (objects),
- do review question 9 on pg 236, and exercise 3 on page 237.
- Write a program which prompts true/false boolean values for A
and B, and then prints out the value of " A && B" and "(! A) ||
(!B)". What's interesting about these two particular combinations?
- do exercise 3 on page 255.
- Create a web page that displays the text "this page is wide" or "this page is narrow" depending
on how wide the web page is when it loads using "document.width".