In-class examples and more
CIS 180 L
Intro to JavaScript
Fall 2006
Last modified: Mon Sep 25 17:17:15 PDT 2006
Important Note:
This is a selection of files and examples, most of which were
mentioned or used in the class sessions. It may not be a comprehensive
list. Formatting is generally minimal.
- Class session 10, 09-21-06: JavaScript security concerns
- Class session 9, 09-19-06: Cookies and JavaScript
-
js_prop_traverse1.html
- "bonus" aside demonstrating that one CAN use a
for..in
loop to traverse all of the
properties of an object;
click
here to run
-
js_prop_traverse2.html
- "bonus" aside demonstrating that one CAN use a
for..in
loop to traverse all of the
properties of an object; (and in a table built
with the help of a little table-row function, too);
click
here to run
-
js_cookie1.html
- first cookie example: setting cookies;
click
here to run
-
js_cookie2.html
- second cookie example: viewing cookies;
click
here to run
-
js_onload_cookie1.html
- using a cookie to save a value obtained with a
prompt popup during an onload event;
click
here to run
-
js_onload_cookie2.html
- grabbing the value from js_onload_cookie1's
cookie and using it to display a greeting;
click
here to run
-
js_onload_cookie3.html
- also grabbing the value from js_onload_cookie1's
cookie and using it to display a greeting;
click
here to run
- Class session 8, 09-14-06: JavaScript browser detection
-
lect08_projected.txt
- some random projected notes from class
- js_nav1.html
- first example displaying some properties of
the navigator object, which contains information
about the client's browser; also includes an example
of an HTML table;
click
here to run
- js_nav2.html
- print an appropriate alert box depending on
the name of the browser the client is running;
click
here to run
- js_nav3.html
- show a few more of the navigator properties,
and a property I added to see if I could;
click
here to run
- Class session 7, 09-12-06: A Taste of HTML Forms and Javascript
- Class session 6, 09-07-06: A Taste of JavaScript Array, String, Date, and
Math objects
-
lect06_projected.txt
- some random projected notes from class
- js_arr1.html
- demo with JavaScript Arrays;
click
here to run
- js_arr2.html
- demo with JavaScript Arrays;
click
here to run
- js_arr3.html
- demo with JavaScript Arrays;
click
here to run
- array_play1.html
- Array, part 1 - examples typed into W3Schools JavaScript
School Examples window (slightly edited after class);
click
here to run
- array_play2.html
- Array, part 2 - examples typed into W3Schools JavaScript
School Examples window (slightly edited after class);
click
here to run
-
js_assoc_arr1.html
- demo with JavaScript associative Arrays;
click
here to run
- string_play1.html
- String examples typed into W3Schools JavaScript
School Examples window (slightly edited after class);
click
here to run
- date_play1.html
- Date examples typed into W3Schools JavaScript
School Examples window (slightly edited after class);
click
here to run
- math_play1.html
- Math examples typed into W3Schools JavaScript
School Examples window (slightly edited after class);
click
here to run
- Class session 5, 09-05-06: Intro to JavaScript objects,
document objects, and even the Document Object Model (DOM)
- Class session 4, 08-31-06: Simple Intro to JavaScript events
(original event model)
-
lect04_projected.txt
- some random projected notes from class
- js2.html
- example from Week 1, revisited --- because
it has an event handler;
click
here to run
-
js_ugly_event_handler.html
- an UGLY event handler example,
because it uses several JavaScript statements as
an event handler attribute's value, instead of
calling a JavaScript function performing those action;
click
here to run
-
js_better_event_handler.html
- a better event handler example,
because its event handler calls a JavaScript function
as its attribute value;
click
here to run
-
js_onunload.html
- handling an unload event with an onunload
event handler attribute;
click
here to run
-
js_link1.html
- plain HTML demonstrating using tag <a> for
a hyperlink, unordered lists (<ul>), and ordered
lists (<ol>);
click
here to run
-
js_mousy1.html
- handling a mouseover event with an
onmouseover event handler;
click
here to run
- Class session 3, 08-29-06: JavaScript Basics, continued
-
lect03_projected.txt
- some random projected notes from class
- js_nullplay.html
- experiment to answer the question: can you use ===
to distinguish null from "null"?; answer: I think so...
click
here to run
- js_ck_input1.html
- experimenting with seeing if can tell if
user clicks cancel or enters a number when I want
something else;
click
here to run
- js_ck_input2.html
- experimenting with seeing if can tell if user
clicks cancel or enters a non-number when I
want a number;
click
here to run
- js_ck_functs.html
- testing functions canValueBeNumber and
canValueBeInteger, to make it easier to
test if a response entered by a user at, say,
a prompt can be converted to a number or an integer
by Number function;
click
here to run
- Class session 2, 08-24-06: JavaScript Basics
- Class session 1, 08-22-06: Intro to JavaScript
-
lect01_notes.txt
- some random projected notes from class
- js1.html -
example of a JavaScript within an HTML body;
click
here to run
- js2.html -
example of a JavaScript function within an
HTML head;
click
here to run
-
obnoxious_greet.js - a tiny external JavaScript
- js3.html -
example of an HTML page calling an external
JavaScript, obnoxious_greet.js;
click
here to run
Back to Course Home Page
Please send questions to
st10@humboldt.edu .