Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation Check if an object exists

    I tend to have this problem generally when i use extensive Javascript...

    I get an error because the user might mouse over or click somwhere that invokes a function that tries to manipulate an object on the page that has not yet been loaded.

    Is there a valid, cross-browser function to check if the object exists.... of if its has been loaded...

    NB: I know of using if(document.all["objID"] and if(document.layers("objID"))
    but I'm looking to find a cross browser way or any other methods...

    I'm open to any suggestions... and i do mean ANY!


  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Code:
    if(window.myVariable)

  • #3
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Post

    thanks man.... i'll try that one!


    Anyone else?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •