\n"); } else { header("Content-type: text/html; charset=utf-8"); } ?> CS-90.3 Assignment 1

CS-90.3 Assignment 1

Introduction

For this assignment, you are to set up your course web site in the course laboratory and verify that you can run JavaScript code successfully

The Assignment

  1. Log into your account and verify the roaming profile feature is working.

    Refer to the TREE Lab Information web page for information on logging into your account in the lab. Be sure to change your password to something secure: Press Ctrl-Alt-Delete after your are logged in, and click on the “Change Password” button.

    Download the template file for the course to your desktop, and extract its contents (a single file named template.xhtml) to the My Website directory under your My Documents directory. Log off, which should cause your “roaming profile” to be copied to the server computer (oak). Now log into a different computer, and verify that the zip file appears on your desktop there and that template.xhtml is in your My Website directory, implying that the work you did on the first computer was successfully transferred to the server when you logged off, and then was transferred from the server to the second computer when you logged into it.

    If you have any problem with this procedure, let me know right away so it can be fixed. Do not do any of the next steps until this one is working correctly.

  2. Set up a Dreamweaver site for your course assignments.

    The Dreamweaver Setup web page tells how to set up a Dreamweaver site for the course, and it was demonstrated in class on September 10th. Set up your site, and then use Dreamweaver to open the template file for editing. Remove all the comments from the file, and close it.

    Duplicate the template file and change the name of the copy from “Copy of template.xhtml” to “index.xhtml”. Open index.xhtml in the Dreamweaver code editor, and change the content of the title element to something meaningful.

    Edit the contents of the h1 element to be something meaningful. It can be the same as the contents of the title element. View your web page using a “tilde-notation” URL: http://sometree.cs.qc.cuny.edu/~youraccountname. Substitute the name of the computer you are working on for “sometree”, and substitute your lab account name for youaccountname.

    If you put an apostrophe in the text of the h1, be sure to make it typographically correct. If you just type the “apostrophe” character on the right side of your keyboard, you will get a straight “prime” character ( ' ), not an apostrophe ( ’ ). Instead, type ’, which will give you a “right single quote” symbol, which will be curved the way an apostrophe should be curved. Throughout the semester, make sure all quotation marks in textual content are typographically correct. (“ = left double quote; ” = right double quote; ‘ = left single quote.)

  3. Add a simple JavaScript program to your site

    Put a script element in the head of your index page, with the src attribute pointing to scripts/sample.js. Actually, this element should already be there because it is part of the template.xhtml file for this course.

    Use Dreamweaver to create a directory named scripts under your My Website directory, as demonstrated in class. Then use Dreamweaver to create a new code file in that directory: rename it from untitled.xhtml to sample.js. Add the following line to the file:

    alert("Your message goes here");

    You can make the message anything you want, and you can use single quotes instead of double quotes if you prefer.

    Now reload your web page and verify that the alert dialog-box shows up before the rest of the page is rendered. Note that simply reloading the page will not let you see this timing if the reloaded page looks exactly like the newly-loaded page. Figure out a way to observe this effect.

  4. Validate your site.

    Make sure the green "OK" icon shows in the lower right corner of the browswer window when you are viewing your page. Then click on the XHTML link at the bottom of the page to be sure you get the corresponding verification from the W3C online validator. If either check fails, you have to figure out what is wrong with your code and fix it before submitting the assignment.

    Note that there is no style sheet for the web page yet, so there is no need to validate any CSS.

Submit The Assignment

When you have tested your web site and verified that everything validates and runs correctly, log out so your site will be copied back to the server. Then send me an email to let me know your assignment is ready for grading: I will copy your site from the lab server to babbage to verify that it is correct.

Send your email to vickeryatbabbage.cs.qc.cuny.edu with CS-90.3 Assignment 1, spelled and capitalized just like that. Be sure to put your email address inside the message you send.