CISC 2350 -- Information & Web Programming
Examples
These examples are used in the lecture slides. Use your browser's
View Page Source feature to see the XHTML that produces what you see.
- Introduction to HTML
- Tags for head and body
- Organizational tags
- Tags for text style
- Lists
- Miscellaneous tags
- Tables
- Tables
- Forms
- Anchors
- Anchor that opens in new page
- CSS Style Sheets
- Embedded style sheet
- Using style classes
- Using pseudo-classes
- Using pseudo-elements
- Inline styles
- Using external style sheet
- Borders, margins, padding
- Controlling display of elements
- Introduction to JavaScript
- Today's date, first version
- Today's date, with syntax error
- Today's date, second version
- Today's date, third version
- Today's date, fourth version
- Addition of two numbers
- Centigrade to
Fahrenheit conversion
- Addition of
user-provided numbers, with bug
- Addition of
user-provided numbers, corrected
- Addition of
user-provided numbers, more concise version
- Legal age calculation
- Legal age
calculation, more concise version
- Legal age
calculation, even more concise version
- Solution to Project
3, as worked out in class
- More JavaScript Examples
- Random foreground &
background colors
- Random image, switch version.
View JavaScript code.
- Random image, array version.
View JavaScript code.
- Random image, 2nd array version.
View JavaScript code.
- Check form before submitting.
- Check form before submitting
(2-D array version).
- Pick a color, any color.
- Cycle thru ads every 5 seconds.
- Alternative
method, with browser compatibility issue
- Same, with
changing links.
- Working With Windows. Note: you will need to allow
pop-ups from this site for some of these to work.
- Pop-up windows.
- Pop-up windows, second
example.
View JavaScript code.
- More advanced JavaScript.
- Setting and reading a
cookie.
- Homework-related examples worked in class April 6 & 13. These are
unretouched (except the corrected version of the last one)
and lack details like the proper DOCUMENT tag or nice
formatting. The windowing example still has the bug(s) it had when
we ran out of time. You are invited to use Firebug to debug it
before looking at the corrected version.
- Temperature chart. (Project
6. Could use better formatting into a table.) This example also
illustrates rounding a number to one decimal place (part of Project 8).
- Day of week today. (Part of
Project 7.)
- Random aphorisms. (Part of
Project 7.)
- Open a child window with a
Close button. (Part of
Project 7.) NOT WORKING.
- Open a child window with a
Close button. (Part of
Project 7.) Corrected version. It still has a lot of unused
stuff left over from the example page we used as starting point,
and does not verify that the open succeeded before writing to the child.
- Clickable image that changes on
mouse-over I have changed the images to ones having the same
background color but different foreground color. To create these
images in GIMP, the trick is to select the text tool (the A in the
toolbox) and click on the text layer in the image to select it.
Then in the toolbox you can use the text color chooser to pick a
different color.
- Ajax.
- Pull-down menu to
select an advisor name and get contact information. This
does not use Dojo or Prototype package.
JavaScript code.
XML description of
advisors.
- Text box for typing
words as suggested completions appear below. This
does not use Dojo or Prototype package.
JavaScript code.
Word list (large).
PHP source of CGI
that reads the word list and selects the words that match the
text typed so far. (PHP not covered in class yet.)
- Text box for typing
words as suggested completions appear below.
JavaScript code. This
uses Dojo package to simplify the HTTP request.
(Word list and PHP CGI are same as above. HTML is too.)