| [Origins][Who
                  Should Read this
                  Book?]
 [Outstanding
                  Features]
 [The Web
                  Site]
 [Coverage
                  Overview]
 [To
                  Instructors]
 
 Origins
                  
                   xxxPrior to the
                  summer of 1998, the Academic Innovations Group at
                  Lake Forest College called for proposals for new
                  and innovative courses. My proposal called for a
                  "from the ground up" introduction to programming
                  using the Internet. Perhaps the most significant of
                  the proposed features was that the course was to be
                  accessible to a general audience, including
                  students majoring in the Arts, Humanities, and
                  Social Sciences. While general audience computer
                  science courses exist, they are primarily geared
                  toward computer literacy, rather than toward
                  fostering any significant programming skills.The
                  proposal being accepted, I set out to find a
                  suitable text from which to base the course. On the
                  lower end, I found "Internet literacy" texts. These
                  texts spend whole chapters on topics such as
                  e-mail, news groups, and searching the Internet.
                  But these are the skills that more and more
                  students emerging from high school already possess.
                  On the upper end, programming texts in languages
                  like C++ and Java abound, but these are geared
                  toward computer science majors. Indeed, such
                  courses often turn unsuspecting general audience
                  students off from computer science, rather than
                  providing a gateway. In reality, students often
                  find such courses more difficult than calculus.xxx Fitting into the
                  middle, and suited perfectly toward the general
                  audience, is HTML and JavaScript. All the
                  publications I found relating to these topics were
                  reference-type books, not constructed in such a
                  manner to support a college course. So, during the
                  summer of 1998, I wrote a 250-page manuscript from
                  which to base the new course. While teaching from
                  the manuscript during both semesters of the
                  '98&endash;'99 academic year, I developed a final
                  vision for the book based upon what worked and what
                  didn't. Student input was instrumental in
                  formulating the final plan.Upon the strength of the
                  course-tested proposal, I secured a contract with
                  John Wiley & Sons, Inc. in the summer of 1999.
                  The text you now see was written during the
                  '99&endash;'00 academic year, again while refining
                  it in the classroom setting both semesters. Thus,
                  this book is the culmination of two full years of
                  classroom testing. The course has gained
                  significant popularity on campus among both the
                  general audience and the science majors. In fact,
                  large waiting lists have resulted in additional
                  sections being opened. Popularity has even grown
                  beyond the student base, with other professors and
                  secretaries taking the course. I have even received
                  comments from my students' parents who like the
                  book, and have found its contents valuable.
 [back
                  to
                  top]Who Should Read this Book?
 xxx The answer is
                  simple. Anyone who wishes to arm themselves for the
                  21st century with substantive Internet programming
                  skills. In short, this book covers the "nuts and
                  bolts" of programming on the Internet. To
                  skillfully publish information on the Internet, one
                  must gain a proficiency with HTML and web page
                  construction. To process information one must learn
                  programming fundamentals. This book provides the
                  fundamentals that one must learn in order to pursue
                  virtually any other programming endeavor on the
                  Internet. It is important to learn the fundamentals
                  now so that one has the tools necessary to learn
                  newer, emerging technologies as they become more
                  commonplace. Simply put, this book contains those
                  core fundamentals.The book assumes no prior
                  knowledge of HTML or a programming language.xxx The prerequisite
                  skills can be summed up succinctly. As far as the
                  computer goes, the reader should be familiar with
                  word processing, creating, and organizing
                  documents. On the Internet side, the reader should
                  be familiar with surfing the Internet with a
                  browser.That gives considerable latitude. Advanced
                  high school students would be equipping themselves
                  well by arming themselves with the skills presented
                  in this book. Anyone in a general collegiate
                  audience would be remiss if he or she were to
                  graduate without possessing these skills. Anyone in
                  the professional setting wishing to be better
                  equipped for the Internet revolution will find the
                  skills fostered in this book indispensable. In
                  short, if you know how to use a computer, and wish
                  to develop your skills further in the Internet
                  environment, you should read this book. The reader
                  who has some knowledge of programming will
                  certainly find the HTML skills useful. Moreover,
                  the reader with some knowledge of a compiled
                  language like C++ will find the portable,
                  interpreted JavaScript language a refreshing
                  change, especially given the natural graphic user
                  interface that HTML forms provide for user input.
                  The only audience to which we would not recommend
                  this book, is that of the professional programmer.
                  Indeed, the highly skilled programmer may be better
                  suited reading a professional reference book on
                  HTML, and one on JavaScript.
 [back
                  to
                  top]Outstanding Features
  The book is
                  designed to be platform independent. This means
                  that the reader can use virtually any type of
                  personal computer. All that is required is a basic
                  text editor, which any computer provides, and a
                  relatively current web browser, which can be
                  downloaded for free. Thus, it is not required that
                  the reader purchase any software. The HTML and
                  JavaScript coverage sticks to a subset of the
                  languages which will work on any version 3 or
                  higher of the Netscape or Internet Explorer
                  browsers. Moreover, other emerging browser types
                  also support this common subset of HTML and
                  JavaScript, and on virtually any computer type. The book introduces
                  programming with objects. The Document Object Model
                  and HTML form objects provide a perfect setting for
                  using objects. So, not only does this book foster a
                  proficiency for using conventional programming
                  structures (variables, decisions, functions,
                  arrays, and loops), but also provides a gentle
                  introduction to objects. The book is, thus, a
                  perfect introduction for anyone wishing to learn an
                  object oriented programming language such as
                  Java.
  The book covers the
                  basics of web server accounts and transferring
                  documents web servers. It also covers strategies
                  for maintaining and updating a web site on the
                  server. However, if a web server account is not
                  available to the reader, those topics can be
                  omitted with no difficulties whatsoever.
  Each of the 18
                  lessons features a summary, review questions, and
                  exercises. The exercises feature both stand alone
                  exercises, and two project threads that run
                  throughout the book. The project threads guide the
                  reader through the construction of a structured web
                  site&emdash;a site that eventually evidences all of
                  those skills acquired through reading this book.
                  The first project thread, which features
                  development of a personal web site, is also ideal
                  for someone who wishes to read this book, but is
                  not formally enrolled in a course.
  The book contains
                  several optional sections that may be used to
                  provide an extra challenge for the more advanced
                  reader. Often, a general audience contains a
                  variety of backgrounds. The optional material
                  provides extra latitude for confronting that
                  challenge.
  The book is fully
                  supported by a web site.
 [back
                  to
                  top]The Web Site
  The web site
                  contains all of the examples and figures of the
                  book for use in classroom demonstration. Moreover,
                  the interactive nature of many of the examples
                  warrants such on-line access so that a true feel
                  for the examples can be realized. The web site also
                  features reference to many on-line materials, such
                  as freeware and shareware applications, that can be
                  used as valuable tools while developing the
                  material of this book. Some of the exercises
                  are inextricably bound to the web site. For
                  example, the reader may be asked to incorporate
                  downloadable materials from the web site into the
                  pages they construct, or may be asked to
                  approximately duplicate a page pictured on the
                  site. For another example, some exercises in Lesson
                  18, require the reader to submit HTML form data to
                  a CGI program on the web site. The web site also
                  provides a perfect place to provide newly designed
                  and updated exercises, making the text a
                  continually evolving instructional resource.
  The book contains
                  reference appendices for both of HTML elements, and
                  JavaScript objects. These are valuable in a
                  reference capacity after the course is completed.
                  Moreover, HTML and JavaScript are constantly
                  evolving. So, as new features become uniformly
                  supported on all web browsers, the web site will be
                  updated with supplements to the reference
                  appendices. In this way, the text will remain
                  current in a reference capacity.
  The solutions to the
                  exercises are available to instructors via a
                  password protected web site.
 [back
                  to
                  top]Coverage Overview
 Lesson 1 gives a brief history of the
                  internet, and covers the fundamentals about how the
                  internet and world wide web work. The internet is
                  explained in terms of IP addresses, servers,
                  routers, and packets. The world wide web is
                  explained in terms of the URL, web protocols, and
                  domain names. In the process, a basic foundation of
                  internet vocabulary is developed.
 Lesson 2 begins to explore the various types
                  of transactions on the internet. This includes
                  transferring web pages to browsers for viewing
                  (http), transferring web pages to web servers so
                  that they are available on the internet (ftp), and
                  talking to web servers to set passwords(telnet).
                  Lesson 2 also explores the nature of web server
                  accounts and public directories. This lesson may be
                  omitted if web server accounts are not
                  available.
 
 xxx Lessons 3 through
                  8 provide a conceptual introduction to HTML and web
                  page construction. The coverage of HTML is not
                  exhaustive, but sticks to a subset of HTML that
                  works in virtually any browser. Moreover, topics
                  such as audio and video are omitted in favor of the
                  fundamental concepts. These core concepts are the
                  syntax of tags and attributes, linking and site
                  structure, various uses of images, and page
                  formatting with tables and frames. Mastery of these
                  concepts provides a perfect graphical user
                  interface for the last ten lessons of the book in
                  which JavaScript programming is used to support
                  HTML forms and web pages. While Lesson 7 mentions
                  the virtues of HTML editors, use of an editor
                  remains optional throughout the remainder of the
                  book. But when an editor is adopted, the core
                  concepts presented in Lessons 3 through 8 are
                  precisely those needed to skillfully use it.
 Lesson 3 explores construction of web pages
                  using basic HTML tags. The basic syntax of HTML is
                  introduced.
 Lesson 4 explores use of attributes in HTML
                  tags to more precisely control HTML markup
                  instructions. In the process, pixels, hexadecimal
                  colors, and fonts are discussed. (Appendix C
                  provides full detail on hexadecimal color
                  representations.) Lesson 4 also includes an
                  optional section which introduces style sheets.
 Lesson 5 explores hypertext links in web
                  pages. Hierarchal and linear linking strategies for
                  web collections are explored. With potentially
                  larger collections of documents to deal with,
                  Lesson 5 also introduces strategies updating a web
                  site on a web server. Named anchors are also
                  covered in detail.
 Lesson 6 explores the nature of images, and
                  their inclusion in web pages. In the process,
                  different types of images are explored as well as
                  different ways images can provide extra
                  functionality in a web page. Lesson 6 concludes
                  with an optional section which covers image maps.
 Lesson 7 first covers lists, and then turns
                  to the more important notion of HTML tables. In
                  particular, tables are used to provide entire
                  layout structures for web pages.
 Lesson 8 covers HTML frames as an
                  alternative page layout mechanism. Here the
                  differing functionalities of tables and frames are
                  compared and contrasted.
 xxx The remainder of
                  the book is dedicated to JavaScript. Again, to
                  insure full browser support, the book adheres to a
                  standardized subset of JavaScript (and JScript).
                  The goal is a marriage of programming theory and
                  application. Indeed, the need for variables,
                  decisions, functions, objects, loops, and arrays is
                  motivated in a natural way using the graphical user
                  interface that web pages and HTML forms provide.
                  Throughout Lessons 9-18, the virtues of knowing
                  HTML fundamentals are overtly manifested. Moreover,
                  with the introduction to syntax and coding provided
                  in Lessons 3-8 by HTML already in place, the
                  transition to the rigors of actual programming is
                  not overly arduous.
 Lesson 9 provides an overview of HTML forms,
                  and their roll in obtaining input from the user.
                  Moreover, Lesson 9 explores the nature of
                  JavaScript and its roll in processing form data in
                  the client-server model. This lesson also points
                  out that JavaScript is not Java.
 Lesson 10 formally introduces JavaScript and
                  the use of variables to store user input. The
                  complex HTML form object structure is not yet
                  introduced, in favor of using the prompt box to
                  obtain user input. The nature of writing programs
                  and the types of potential programming errors are
                  explored.
 Lesson 11 explores the ability of Javascript
                  to make decisions based on user input, again
                  obtained with prompt boxes. The decision making
                  capabilities are employed both to process
                  information based on user input, and to alert the
                  user if improper information is supplied.
 Lesson 12 introduces the nature and syntax
                  of using objects in programming. This discussion
                  has proven both valuable and necessary in the
                  transition to using HTML forms to obtain user
                  input. Several hands-on objects are introduced with
                  the Document Object Model.
 Lesson 13 turns to the use of HTML forms for
                  obtaining user input. This lesson introduces the
                  HTML input elements used for obtaining textual
                  input, and using HTML form buttons for calling
                  JavaScript functions to process the input. In the
                  process, the concept of local vs. global variables
                  is introduced. The theme of verifying that the user
                  has entered proper input is further emphasized.
 Lesson 14 augments the input capabilities of
                  HTML forms by exploring checkboxes, radio buttons,
                  and pull-down menu's. These option-creating form
                  elements further emphasize the decision making
                  capabilities of JavaScript. Moreover, Lesson 14
                  introduces the necessity for using arrays.
 Lesson 15 explores repetition in programming
                  using loops. The utility of looping is emphasized
                  by the need to process larger HTML forms, but
                  without undue redundant code. Looping over arrays
                  of HTML form elements further explores using
                  arrays--arrays of objects.
 Lesson 16 covers the manual creation of
                  arrays, and their utility. The arrays used prior to
                  this lesson are created automatically when a
                  browser loads and HTML form. One of the main
                  applications of self-defined arrays presented in
                  Lesson 16 involves pre-loading images from the
                  server. The pre-loaded arrays of images are used
                  for purposes such as cycling image displays in web
                  pages.
 Lesson 17 explores creating self-defined
                  functions that use parameters. The reader will have
                  been creating self-defined functions since Lesson
                  13, but ones without formal parameters.
                  Applications of the detailed discussion on
                  functions include creating image rollovers in web
                  pages, and creating functions to aid in
                  verification of the validity of user input into
                  HTML forms. To augment form verification, the
                  string object is also introduced.
 Lesson 18, the final Lesson of the book,
                  introduces the security capabilities of JavaScript
                  and the password form element. JavaScript's
                  security weaknesses are discussed, together with
                  the associated necessity for submitting HTML form
                  data to the server. The submit button is explored,
                  and hidden form elements are employed to facilitate
                  the submission of "cleaned up" form data to the
                  server. No server-side programming is introduced.
                  Rather, the existence of server-side programs is
                  assumed, and the nature of the client-server model
                  (as introduced in Lesson 9) is further explored.
                  Several examples and exercises actually feature the
                  submission of form data to server-side Perl
                  programs on the web site for this book.
 [back
                  to
                  top]For the Instructor: Dependency and
                  Organization
 xxx The following
                  diagram indicates how the Lessons depend upon
                  previous ones in terms of necessity of
                  coverage.
  
 xxx The book has
                  been designed for flexibility of coverage. A course
                  for the most general of audiences requires
                  significant time and detail in Lessons 1 through 8,
                  perhaps half a semester. Such general audiences are
                  not only learning HTML, but bolstering their
                  general computer skills. The goal is then to cover
                  Lessons 9 through 14, and Lesson 18 if time
                  permits. This provides a gentle introduction to
                  programming and using objects. The end product is a
                  feel for programming and an understanding of the
                  nature and capabilities of HTML forms.xxx If it is desirable
                  to cover programming in more detail, the HTML
                  lessons can be covered more quickly, perhaps in a
                  third of a semester. This level of coverage is
                  appropriate for a more advanced audience or one
                  with some prior knowledge of constructing web
                  pages. At any point after Lesson 14, Lesson 18 can
                  be covered as a fitting capstone for the course. In
                  this way, as many (or all) of the desired
                  programming concepts can be covered. The end
                  product is a proficiency with programming
                  fundamentals and a comprehensive grasp of the
                  capabilities of JavaScript as used to support web
                  pages and HTML forms.
 xxx Upon a cursory
                  inspection, it might appear that the book jumps
                  around a bit in terms of covering programming
                  fundamentals. The first draft of this book did, in
                  fact, feature a more detailed coverage of
                  structures such as loops and arrays, before objects
                  and HTML forms were introduced. Several reviewers
                  commented that this approach failed to let the true
                  flavor of JavaScript come through until very late
                  in the text. The JavaScript presentation was
                  analogous to that of a Pascal text, for example.
                  With the added burden of early presentation of more
                  programming structures, it was difficult to do
                  justice to HTML forms in the allocated time of one
                  semester. Indeed, that approach didn't work as well
                  with the most general audience. The students left
                  with a feel for programming, but little feel for
                  objects, HTML forms, and the practical capabilities
                  of JavaScript.
 xxx The organization
                  of the current text, as seen above, has proven
                  highly successful. Not only does the approach offer
                  significantly more latitude in terms of structuring
                  courses for varying audiences, but it ensures
                  coverage of HTML forms and the flavor of
                  JavaScript. A surprising by-product of this
                  organization is that the concepts of functions,
                  local variables, and arrays are covered in Lessons
                  10 through 14, but in a non-rigorous way. For
                  example, it is necessary to handle user events by
                  calling self-defined JavaScript functions, and to
                  access HTML form elements using the elements[
                  ] array, which is created automatically by the
                  browser. Lessons 15 through 17 then add rigor to
                  these concepts in a natural way, and with practical
                  applications. Finally, regardless of the extent of
                  coverage, Lesson 18 provides a natural closure for
                  the course.
 Craig D. Knuckles[back
                  to top]
 |