Web Design Small Cover

Buy the PDF of
Web Design:
A Complete Introduction

See the book at amazon.co.uk or amazon.com

Related Site

Web Security Topics

Related Books

Secure Communication Cover

Securing A Server Cover

Teaching Notes for Chapter 7

Download the end-of-chapter questions. (Zipped plain text files, UTF-8 encoded.)

When we first planned this book, we intended to deal lightly with JavaScript, since disillusionment with the excesses of Dynamic HTML was leading it into decline. By the time we came to write this chapter, interest in JavaScript had been reawakened by the high profile of Web applications that used the AJAX approach to interactivity. In order to do justice to this phenomenon, we ended up writing the longest chapter in the book.

This material should present no problems at all to computing students. JavaScript is a simple language, based on principles that will be familiar to most computing students. We assume that all such students will be comfortable programming with objects. To write scripts that manipulate the DOM, it is not necessary to enquire into ECMAScript's odd approach to inheritance, and the absence of conventional classes is not really relevant to programs as short as the ones we describe. If you wish to explore more advanced scripting techniques, such as the use of libraries like scriptaculous, you will need to use other reference material.

What about visual design students? We don't know your students, so we can't be certain how they will get on with this chapter, but it seems highly likely that many visually trained students will not find it easy to cope with the purely symbolic business of programming. If you have reason to think that the chapter will be too challenging for your students, then leave it out. The DHTML debacle demonstrated that the last thing that is needed on the Web is more bad programmers. You should, however, demonstrate the examples in action and explain what is being done by scripting and why, so that the students have an appreciation of what scripts can do.

Nevertheless, we have tried to include enough material about programming in this chapter to enable a student who has never written a program to create simple scripts to use on Web pages. If you feel that some or all of your non-programming students can learn to write some scripts, we recommend that they be encouraged to try, in order to see for themselves how it works. Our main advice would be to take things slowly, and to let concepts sink in, before getting down to the details of syntax. Possibly, it would be a good idea to break the material into two or more separate chunks, with a break in between, during which you cover material from one of the design chapters to avoid overloading them with too much scripting all at once.

When teaching this chapter, it is essential that you make students do some practical work. They cannot learn to program without doing any. Encourage students with no prior programming experience to take existing code and change it before they attempt to write their own scripts from scratch.

If you find the treatment in this chapter too dense, but wish to teach something about DOM scripting, you might consider using Jeremy Keith's DOM Scripting book as a supplement to ours for this part of the course.