|Table of contents|
- Case. Check your variables (e.g. strName is not the same as strname)
- Variable names: Cannot have a space in them (indeed try to eliminate spaces in any names and use CamelCase where possible).
- Arrays. an array must be declared first before you can assign values. e.g. var arrX = new array(); arrX=1;
- Check for the correct use of : and ; e.g. font-weight; bold; should be font-weight: bold;
- Check for any stray quotes - give really unpredictable results :(
Semantic (meaning) errors
1. In nested statements check semicolons
2. getElementByID .. is null
3. '<name>' is null or not an object
- Very carefully check the object name is the same. E.g. if you have cut n pasted from a web example is the form name the same as the one you have used !
- Tecumseh Group, Inc.(2010)
Problem: It appears that IE doen't strip out leading spaces in arguments so
msg = window.open (""," DisplayWindow","scrollbars =yes, resizable=yes");
works in Firefox but not in IE.
Solution: Remove leading space
msg = window.open ("","DisplayWindow","scrollbars =yes, resizable=yes");
It appears that IE 8.0 requires the onClick functions to be in quotes if you terminate the input box with a /
i.e. both work (but the second is more standards compliant (but a /> in the first example does not work :(
- Tecumseh Group, Inc.(2010) Why do I get a null or not an object error?. Retrieved March 14, 2010 from http://www.tek-tips.com/faqs.cfm?fid=3046