Lab Outline week 3
Labs Start On the Hour
Please arrive at 026 Kla early enough to be seated and do the following:
- start FireFox, login to our Blackboard course site, open Schedule > Class Calendar
- in the calendar, click the link for the lab outline for the week
- start SSH, connect to shell.uoregon.edu, & open a File Transfer window
- start TextPad
If you arrive late, your lab instructor will not be able to take time away from the other students to fill you in on what you missed.
Lab Topic for Week 3
Scripting dynamic hyperlinks using cookies.
Lab Exercises
- Open this directory in a new tab in your browser: ../code/archive/w5.
Dowload two files to your /382/examples/ folder: user-prefs-pt3.html and welcome-v4.html.
Your GTF will explain how the script in user-prefs-pt3.html saves the user preferences by setting category cookies.
Your GTF will explain how the script in the body section of welcome-v4.html uses a JavaScript database in the head section to dynamically generate hyperlinks.
- Modify your /382/html/BH-sign-in.html you are working on for project 2 as follows: Suppose the user has checked your first and second category checkboxes in your form. Then saveUserInfo() should set the following cookies:
category1=true; category2=true; category3=false;
category4=false; ... ;category9=false;
- Modify your /382/html/BH-home.html you are working on for project 2 as follows: Add a script to the body section that generates a genre hyperlink for each category the user has selected. You will need to paste the JavaScript database into the head section.
Simplifying Assumptions: To keep this simple enough to complete during lab: the JavaScript database can be an array of size two. The user can select just the initial category in BH-sign-in.html.
That way, the odds are good that you can get a single dynamically generated hyperlink in BH-home.html by the end of your lab session.
Note: the target document for the dynamically generated link does not have to exist at this time: If you can implement a link that generates a 404 Page Not Found error, that is excellent.
- If you do not have time to complete this exercise in your lab, please complete it at another time during the next week. It's best not put this off, as project 3 requires this exercise to be completed successfully.
The Learning Environment
At the start of the term, your lab instructor will regularly stop and ask the
question, "Can all of you hear me, especially in the back of the room?
Can
you
understand what I am saying?"
It's important that you are able to follow along as the instructor presents
material. If you cannot hear or understand what is being said, please raise
your hand and say (politely) that you are having difficulty following the presentation.
The lab instructor will appreciate your assistance.
It's important that everyone follows along in
unison. Please let your lab instructor know if you get stuck and s/he will
help you before going on to the next step.
Also, please keep in mind that your responsibility is to pay attention and
follow the instructor's directions. In particular, you
should not be reading email, surfing the web, visiting with other students,
etc., during the lab. Please save those activities for after the lab.
In addition to B26 Kla, You can work on your 110 projects in B13 Kla and
B26 Kla or in any CC microlab on campus.