programming
Mention IE problem from last class.
Progress so far?
Discuss basic ideas of programming languages,
and how those things look in javascript.
basics
Discuss basic concepts in programming: variables, numbers, strings, lists, conditionals, loops, ...
more javascript tutorials and exercises
examples
Create a web page to display a randomly chosen picture.
Step 1 : make a list of the URL's for the pictures.
Step 2 : put a random number into a variable
Step 3 : use that random as a subscript into the list to get one of the pictures.
Step 4 : modify the image tag in the html document to include that URL.
4a) document.getElementByID to get that part of the webpage
4b) modify the piece that has the image with one of these :
* choice 1 : something.innerHTML = ...
* choice 2 : imageObject.src = ...
* choice 3 : document.write(...) with javascript in webpage itself
// Return a random integer 1, 2, 3, ..., max
function randomInteger(max){
return Math.floor(Math.random()*max)
}
Try these various ideas in class ...
which we did; I've attached the results.