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.