CCSF Spring 2010 / CNIT 133 Homework Notes and Difficulties Page



Homework
Assignment
Note &
Difficulities
Home Page -
immutableforce.com
Return to www.immutableforce.com Home Page
HW 1:
Homework Summary Page
No Real issues. Setting up a web page as menu of homework assignments as a table of choices was pretty straight forward. I took time to set up additions to my site's CSS file for design considerations such as each page has it's menu choice highlighted to give a visual cue for the user.
HW 2:
Basic Operations
I had a couple of gotacha's while working on assignment 2

I use date.modified to post on my pages when they were last updated. With assignment 2, I found when using chrome, I get the same (wrong) date/time as I get using Safari...

Safari & Chrome use the same engine (Webkit) yet Flock and Firefox use the Mozilla Engine (Gecko) which both show things correctly. I am seeing an 8 hour difference in time for the date updated. It is apparently a long-standing issue. Webkit does not compensate for the Timezone differences between the location of the server and the location of the client (browser). Gecko does figure this in as it should. You can see this by looking at the bottom of any of my assignment 2 webpages.

Another thing I discovered it you can not embed a javascript in the middle of a table construct. It will not validate to XHTML 1.0 standard. You must either process the table contents separately and update the table or you can have the entire table build by way of the script.

I like how we can make changes to a page without having to totally repaint the page.... I have seen a few websites take advantage of that very nicely.
HW 3:
Decision Logic I
The most confusing thing I had happen was that something worked fine in Safari but got weird in Firefox. I was updating a cells that contained my input fields, so that they would include dollar signs and other labeling type material and my output started showing only every other line instead of every line. As it happens, it appears that this updated action was removing input fields from the output and as such my javascript retrieval of page elements (such as input fields (and how many I had) was altering on the fly. This is a problem if I ran my loops forward from 0 to x. It becomes a non issue if you run the loops from x down to 0.
HW 4:
Decision Logic II
I really did not have any real difficulties with this assignment. One thing I want to figure out is on part 4 where I added the ordered list when input is correct, I have not quite figured out how to remove the the ordered list when they input an incorrect entry like "4" or "A". I do issue an error alert box, but the ordered list from the previous input remains.
HW 5:
Functions
A couple of things I had to track down were:
  1. Having a function return more than one value (return an array)
  2. My reset buttons were generating and function not found error. I found this tidbit on the web....
If a form control (such as a reset button) has a name or id of 'reset', it will mask the form's reset method.

Once I changed the id= on my reset button to be "reset_button" instead of "reset", I was able to use the following function call without generating an error.

document.getElementById('data_form').reset();
HW 6:
Arrays
I used associative arrays and they are not as easy to use as other languages. The assignment was pretty straight forward.
HW 7:
Objects
Getting more comfortable with COOKIES was really worthwhile

The assignment was pretty straight forward.
HW 8:
Object & Event Model
Take note page 4 does not have the navigation box like the other 3 pages for this assignment. You can still navigate to the other portions of this assignment from page 4 because of the mouseover menu set up for assignment 8 available on page 4. It will make sense when you get there.

This assignment took extra time because the CSS rule names in Firefox are different from the ones in safari. Safari accepts what you would expect. Things such as font-family, background-color are good in Safari but do not work in Firefox. Firefox requires things like fontFamily, backgroundColor. Luckily Safari accepts these firefox-required values as well, so I make adjustments.

HW 9:
Ajax Applications
Part 2:

After I realized I needed separate objects for each input field so that each object could call it's own php file to load data into the field, it was pretty straight forward.

Note for Part 3

If you need to debug your php, it might help if you do something like:

http://www.immutableforce.com/cnit133/poll_vote.php?vote=1

and see if their PHP generates an error.

Explanation:

a. http://www.immutableforce.com/cnit133/poll_vote.php

This is the php script be executed.. in my case I am running on my website. People using hills should use THEIR website location.

b. ?vote=1

The question mark is a separator between the script and a list of parameters into the script.
so...
? - a separator
vote - name of a variable used inside the php script
= - assignment of a value to the parameter
1 - Value being assigned to vote and passed into to the execution of the script.

In the case of our php script 0 is another valid value for testing.

Since I have taken PHP, I was aware of it. It was very helpful when I was getting no result page. My php was failing but my hw9_part3.html was not giving any clues ... just a page that did not update.

After running the PHP manually from the web browser, I was able to isolate and correct some coding issues. Once the PHP issues were resolved, my ajax page was working perfectly.


Valid XHTML 1.0 Strict Valid CSS!