\n"); } else { header("Content-type: text/html; charset=utf-8"); } ?> Script Programming For The Web

Introduction

There are four elements of a typical web site that this course is designed to pull together: content markup (XHTML), content presentation (CSS), user—browser interaction (JavaScript) and content management (PHP/SQL). The prerequisite for this course is Computer Science 081 or the equivalent, which should have given you a firm grounding in XHTML and CSS.

JavaScript is a programming language that is available in all browsers as well as several other applications, including Photoshop, OpenOffice, and Flash (where it is called ActionScript). In all these environments, JavaScript is used to extend and customize the behavior of the base application. In the case of browsers, JavaScript can be used to validate information entered by users locally before submitting that information to a remote server, as well as to provide many forms of user interaction that go beyond those available using CSS. JavaScript is the 'J' in AJAX.

Content management refers to a combination of programs and a database that run on a remote server, often the same server that delivers web pages when the user clicks on a link. Server-side programs can be written in any programming language; in this course you will work with PHP, a scripting language largely derived from an earlier scripting language, Perl. PHP is the most widely used server-side scripting language in use today; other popular languages (besides Perl) are Ruby, Python, and Java. (Java, by the way, has nothing to do with JavaScript.)

There are several database systems that can be used for managing content: Oracle is widely used on very large corporate and shopping web sites; MySQL, owned by Sun Microsystems, is an extremely popular system that is available at no cost. We will use PostgreSQL for our databases. It is free and open source, and historically has had a better feature set than MySQL. This course concentrates on JavaScript and PHP programming, so the choice of which database system we use will have little impact on your work in the course.

There is a laboratory in the Computer Science Department where we have Apache web servers with PHP support installed, access to PostgreSQL databases (one for each student), and industry standard development tools like Dreamweaver. You use the computers in the lab any time the college is open, and you can log into them remotely from off campus anytime, 24/7. Alternatively, you can set up Apache/PHP/PostgreSQL on your own computer, do your assignments there, and then upload your assignments to your account in the lab for final testing and submission.

Topics

The following is a generic list of topics for the course. The actual schedule of assignments and exams is given in this semester’s course web page.

Class NumbersTopics
1

Introduction to Scripting Languages

  • Compilers, Emulators, and Interpreters
  • Shell Scripting: Bash; Cmd.exe, …
  • CGI Scripting: Perl, …
  • Scripting Languages: JavaScript; PHP; Ruby; Python, …
  • Libraries and Frameworks
  • Scripting, Web Standards, and Accessibility
2

Web Site Structure And Operations

  • Client-Server Model: Internet message passing; hosts; ports
  • The Apache Server: Configuration file; modules; log files
  • DocumentRoot
  • Subdirectories: css, scripts, images
  • Life-cycle of a web request from browser’s perspective
  • Server request processing: server-side scripting
3-10

Client-Side Scripting

  • script tags, scripts directories, and .js script files. jsmin and jslint.
  • Embedded JavaScript — Not!
  • Values: numbers; strings; references; booleans
  • Variables, Expressions, Statements, Functions, Arrays, and Objects
  • Events: handlers vs listeners; managing
  • Control Structures
  • DOM Interactions: Form verification; Dynamic Effects
  • Debugging/Optimizing with FireBug
11Midterm Exam
12-20

Server-Side Scripting

  • Server Processing (Apache): embedding in XHTML documents; code scope; generating response headers
  • Variables, Expressions, Functions, Arrays, Objects, Classes
  • Control Structures
  • Receiving and sanitizing form data.
21-28

Client-Server Script Interactions

  • XMLHTTPRequest Processing
  • JSON Processing: JavaScript; PHP
  • XML Processing: Use as a database
Final Exam/Project

Projects and Grading

There will be an ongoing set of programming assignments during the semester. Small assignments will be graded on an "OK"—"Not OK" basis, while larger assignments will be graded on a 10–point scale. The number and sizes of the assignments varies from semester to semester, but in aggregate you can expect them to count 30–40% of your course grade. The midterm and final exams will count equally for the remainder of your grade. Exams are based on concepts and programming techniques required for doing the assignments.

To receive full credit for programming assignments, they must be correct and submitted by midnight of their announced due dates. Assignments submitted up to one week after they are due will receive up to half credit. After one week, no credit will be given but assignments may still be submitted for feedback. Assignments are typically cumulative, so it is generally necessary to complete all assignments, even if their deadlines are missed.