Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Object Referencing

Why do I get a null or not an object error?
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.
Fix:
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

window
  |
  +-------parent, frames, self, top
  |
  +-------location
  |
  +-------history
  |
  +-------document
              |
             +--forms
              |        |
              |       elements (text fields, textarea, checkbox, password
              |            radio, select, button, submit, reset)   
             +--links
              |
             +--anchors

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