Index_D


Post-Project Review: The Center Park Web Site

It is 9:00 a.m. on the Monday morning the Center Park Web site has gone live. As part of your initial project proposal, you are now in a critical meeting with the school administrators to review the functioning of the site to ensure that it meets all required functionality and to make a list of possible future updates.

Imagine, then, that the following sections are "meeting notes" from this discussion, as you—as the site developer—discuss your final product with the school administrators. Also, note that the final section contains a complete listing of each source file for the entire site (this type of source code listing might be something you would provide to the client, especially those who may have the expertise to modify functionality of the site on their own).

Review: The Site Home Page

The first thing to review in the completed site is the site home page. Figures 21.1 and 21.2 show the page and highlight the rotating banner functionality that has been built into the site.

click to expand
Figure 21.1: The Center Park home page, highlighting the rotating banner functionality.

click to expand
Figure 21.2: A different graphic is now being displayed. Also note that navigation buttons at the left of the screen are duplicated in the right frame as hyperlinks.

Requirements Met: the Site Home Page

The home page meets many of the functionality requirements set forth in the initial project request:

  • The rotating banner graphics (in this case, highlighting the general "Support Your Bobcats" message as shown in Figure 21.1, and the advertisement for the "June Bug Festival" as shown in Figure 21.2) help to answer the "screen real estate" issue, in that by displaying each ad for a few seconds, they allow multiple advertisements to share the same space, with each getting equal "air time." Note there is no limit to the number of graphics you can rotate; moreover, you can include hyperlinks within each one so that if a particular group/event being advertised has its own Web site, a link could be provided to it within the rotating ad.

  • As shown in Figure 21.3, the navigation buttons utilize DHTML effects by changing color when the mouse is moved over them. Note as well that the functionality presented by these links is also presented in the right frame. Why do this? In case the user somehow was to get out of the site frame set (and thus lose the navigation buttons presented in the left frame), he or she could still access all the major functionality of the site.

    click to expand
    Figure 21.3: When you move your mouse pointer over each navigation button, it changes color to indicate that it is active and ready to be selected.

  • While this is arguably a simple design (for illustrative purposes only; in the "real world" you might be asked to put a more aesthetic touch to your design), it works well from a functional perspective—all major site functionality is readily available and easy to find and understand, via the names given the button links.

Review: The Log In Function

Because of the omnipresent security concerns with Web sites, more and more organizations of all sizes are seeking to secure specific content. Sometimes, organizations will form "intranets"— versus an extranet or Internet site—in order to make information available only to employees or other authorized persons.

The Center Park Web site is no different. In this case, the secure Log In button, when clicked, presents users with a user name and password sign-in, as illustrated in Figure 21.4.

click to expand
Figure 21.4: The Log In functionality allows users to access private or otherwise secure content within the Center Park Web site.

Requirements Met: the Login Function

JavaScript doesn't have a lot of built-in security functionality, and this "secure" login is indicative of that. Still, the page does have some basic attributes that you could—in a real-world situation— develop in a more robust manner:

  • The password field could be changed to a regular form password field, where the characters that are entered are marked out and represented only by asterisks (this is still only very basic security, but it would prevent, for example, someone from gaining your password while looking over your shoulder as you keyed it in).

  • If this were a production site, each user would have a specific user name and password; however, even in this basic example, you can see the inherent security that is possible by locking out unauthorized access via a user name and password.

Review: The Task Calendar

Once users log in to the site (via the user name and password shown in Figure 21.4), they are presented with their customized calendar of tasks and events, as shown in Figure 21.5.

click to expand
Figure 21.5: The "customized calendar", which is presented to the users after they successfully log in to the Center Park site.

The calendar function, even in this most basic form, is a virtual cornucopia of JavaScript functionality. The following subsection describes how this coding meets many of the defined requirements of the Web site.

Requirements Met: the Task Calendar

The Center Park administrators wanted their site to present users of all types (teachers, students, and parents) an easy and convenient way to keep in organized touch with the Center Park School.

That said, the Task Calendar fits the bill for many of these function requirements:

  • As shown in Figure 21.5, the calendar is specific to each user login (“Welcome John!!).

  • The calendar defaults to the current month and day (the current day is highlighted with a box around it).

  • "Navigation" buttons are presented at the bottom of the calendar, so users can move forward or backward one month in order to view that month's respective calendar.

  • The ability to add a task to the calendar is presented via the "Add task" link at the bottom of the calendar.

Adding a task to the calendar is an important functional component. When the user clicks on the "Add task" link illustrated in Figure 21.5, he or she is presented with the Schedule Task form, as shown in Figure 21.6 below.

click to expand
Figure 21.6: Users can add a task to their calendar via this "Schedule Task" function of the Task Calendar.

To add a task, the user would follow these steps:

  1. First, the user would click on the "Add task" button as shown in Figure 21.5. This presents the Schedule Task screen, as shown in Figure 21.6.

  2. At this point, the first thing to do is select the date of the task. As shown in Figure 21.6, the user would click on the button underneath the "Date of task" text, which in turn brings up the Date Chooser pop-up calendar, as shown in Figure 21.7.

    click to expand
    Figure 21.7: The Date Chooser pop-up allows a user to select a specific date for their task. Note that the date and month can be changed so that the task can be assigned to any date, not just during the current month.

  3. Once a date is selected in the Date Chooser pop-up calendar, it is automatically inserted back into the initial form, as shown in Figure 21.8. Also, the description of the task is also entered. Note that in this case, the following HTML is entered:

    click to expand
    Figure 21.8: Once a date is chosen in the Date Chooser, it is placed into the Date of task field.

     <a href="http://www.centerparkschool.edu/tests/test1.html">Click here to take the      first exam.</a> 

    so that when the task is placed on Donald's calendar for 5/30/2003, it will actually be a hyperlink to the an exam.

  4. Once the date and task description are entered, the user clicks the Submit button and the task is entered on his calendar.

Tip

Why use a pop-up calendar to have a user select a date? First, this gives users an easy method of finding an exact date, both for the current month as well as past7sol;future months. Also, by having them select a date from a pop-up calendar, you ensure that the date format is entered in a uniform, exact way: in other words, this prevents the date of May 30, 2003 from being entered as 5/30/03, or 5/30/2003, or 5.30.2003, etc. Having this uniform method of date selection ensures that the data is handled in the same way in your coding, and prevents potential errors if a data format is entered in an unrecognizable way.

Review: The Online Test Tool

While the Center Park administrators have their reservations about going to a purely online testing environment, they are interested in working with this functionality in the new site.

If you look back to Figure 21.5, you can see that on May 5th, there is a task entitled "Take CS Test." If you click on this link, you will be presented with a glimpse of the online testing component, as shown in Figure 21.9.

click to expand
Figure 21.9: An example of a five-question online test, made possible via JavaScript!

start sidebar
FUNCTIONALITY, YESBUT FOR "ILLUSTRATIVE PURPOSES"ONLY

The code for the Center Park site that is presented in this chapter, while functional, is for illustrative purposes only.

What's the catch, you say? The data entered in the Task Calendar (as well as the online store, which is illustrated a bit later in this chapter) doesn't really go anywhere when the user clicks the various submit buttons. Why is this so? The answer is simple: the data has nowhere to go; specifically, it doesn't have a database to be inserted into.

Integrating a database with your Web site can be a complicated task, depending on the type of functionality you wish to present. However, you will quickly find that you will need this type of functionality if you are to move beyond the most basic functionality. Unfortunately, database integration goes beyond the scope of this book (focusing as it does purely on JavaScript); moreover, there are different programming methods that can be utilized to integrate a database with your site.

That said, then, much of the advanced functionality of the Center Park site is just an illustration of potential functionality that could be achieved if the site were integrated with a database.

end sidebar

Requirement Met: Online Testing Capability

Figure 21.9 illustrates a simple five-question Computer Science test. The user is presented with answer fields, and at the bottom of the screen (not visible in Figure 21.9) is a Submit button for them to click when they have answered all questions. Note that if they do not enter something in each answer field, they will be presented with a warning prompt (more JavaScript functionality here) as shown in Figure 21.10.

click to expand
Figure 21.10: All fields must have something entered into them, or else this error message appears.

When each question has been answered and the Submit button has been clicked, the test-taker's score is immediately returned, indicating right/wrong answers, as shown in Figure 21.11.

click to expand
Figure 21.11: Instant analysis of the submitted answers is possible via the JavaScript functionality of the testing feature of the Web site.

As mentioned above, while the core functionality is here, you would ideally need some type of backend database to capture the scores as well as store the questions and answers. Right now, the questions and answers are hard-coded into the actual Web page file that presents the online test. While this is good for, again, "illustrative purposes," it probably would not be the best solution either from a security perspective or in order to store the results of each test.

Review: A Customizable Web Site

JavaScript can be utilized in conjunction with DHTML in order to produce some neat and functional effects. The site navigation buttons are one example of this; however, an even better example is how the site allows the visitor to set both the foreground and background colors.

When the user clicks on the Custom Navigation button, he or she is presented with the options shown in Figure 21.12.

click to expand
Figure 21.12: User can customize the appearance of the Center Park site.

Requirement Met: Customizable Features

As shown in Figure 21.12, the user can select the foreground and background colors of the site. Figure 21.13 illustrates how choosing black as the background and white as the foreground changes the appearance of the Center Park site.

click to expand
Figure 21.13: A simple custom feature, but one that can make a big impact on the appearance of the site.

While this is again a simple example, it hints at the possibilities in Web page customization features that are possible with JavaScript. Moreover, giving the user this type of control is good customer relationship management and indicates that you—as site designer and/or administrator—are interested in catering to your customers' specific needs and interests.

Review: The Center Park Web Store

The final piece of required functionality, as set forth by the Center Park school administrators, was to have some type of basic Web store, so that visitors could shop for school merchandise (and thus, again, potentially alleviate the need for all those bake sales). Figures 21.14 through 21.16 illustrate the base functionality of the Web Store.

click to expand
Figure 21.14: The home page of the store, listing all the items for sale.

click to expand
Figure 21.15: In this example, the visitor has added one school hat and one school T-shirt.

click to expand
Figure 21.16: By clicking on the Check Out button, the shopper is presented with all the items they have selected and the total charge for the items.

Requirement Met: the Online Store

As with some of the other functionality of the site, in the real world this type of online store would have several other factors that go beyond the scope of this book. Clearly, one of those factors would be how individuals actually pay for their items: Do they get an invoice via e-mail? Are they asked to enter credit card information?

However, even in its "just for illustrative purposes" form, the code presented here could still be considered an online store. How? Perhaps the store is really just a catalog, where shoppers can browse what is available, get a total, and then e-mail their request to the school store or print out a hard copy order form and mail it in. The point here is that— along with other functionality shown in this chapter—the core functionality is provided, and with some customization (as well as integration of a database), the site could easily fit all requirements set forth by the school administrators, even in a real-world setting.




JavaScript Professional Projects
JavaScript Professional Projects
ISBN: 1592000134
EAN: 2147483647
Year: 2002
Pages: 130
Authors: Paul Hatcher

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net