Clip Art Common Mistakes
Pierce Home
Computer Science 555 Website Development using JavaScript and AJAX - 3 Units
Section:
3179
Instructor:
Brad Gilbert
Pierce Mailbox:
612
Email:
pierce@wavethunder.com
Wednesday Office Hours:
5:00 -   5:40 PM COSC 1507
Wednesday Lab:
5:45 -   7:50 PM COSC 1507
Wednesday Lecture:
7:55 - 10:00 PM MATH 1511
Other classes:
CS-575
common mistakes
Question:

What are some common typos?

Answer:
    JavaScript:
        · document.GetElementByID("MyElem"); instead of
          document.getElementById("MyElem");
        
        · document.getElementByTagName("IMG"); instead of
          document.getElementsByTagName("IMG");
          NOTE: Always use uppercase for tag names in JavaScript
              even though they should be lower case in XHTML.
        
        · tagObj.legnth; instead of
          tagObj.length;
        
    XHTML:
        · scr instead of src
        · herf instead of href
        
    CSS:
        · omitting # or . for id or class
        · omitting : or ; inside style properties
        · omitting # before a hex color value
        
    All:
        · omitting closing quote, or mis-matching " and '
        · omitting quotes all together
    
Question:

What are some other common mistakes?

Answer:
    · Uploading your files to the wrong folder.
    · Renaming files, but not updating links to them.
    · Leaving test-code in a production release.
    · Testing a file you edited, but didn't save.
    · Editing one file and testing another.
    · Editing a different file from the one
        that you thought you were editing.
    
    · Copy-and-paste, then forget the minor alteration
        needed for the pasted code.
        For example: Copy-and-paste a tag,
            but forget to change the id of the new tag.
            
    · Omitting a closing tag, >, or mis-matching tags.
    · Omitting a link to your external CSS or JavaScript file,
        or linking to the wrong file.
    
    · omitting closing } or mis-matching { and }
    · omitting closing ) or mis-matching ( and )
    
    · Using a global variable that you thought was local.
    · Writing an "infinite loop".
    · Placing a ; where it does not belong, such as:
        after a loop or if statement.
    
Brad Gilbert · Fall 2011
Computer Science · Pierce College · Woodland Hills CA · 818-719-6401