Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Object Referencing

Why do I get a null or not an object error? by onpnt
Posted: 19 Jan 03

Two main reasons for this error.
1) A script is loaded before the body content is loaded.  
Fix: place the script in a function and call it on a event or (not recommended) place the script below the
body content just above the closing </body> tag
1) You are referencing a parent to child object in the wrong sequence.
Use this reference to navigate through the objects and their child objects on a page.
This is a common error in many scripts.  
For example
document.radio name is an error
document.form name.radio name is valid

  +-------parent, frames, self, top
              |        |
              |       elements (text fields, textarea, checkbox, password
              |            radio, select, button, submit, reset)   

also on a last note:  the need for window.document or window.location has been far long gone.  
Unless your viewer is running the
first version of NN or IE it is not needed.

Back to Javascript FAQ Index
Back to Javascript Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close