View Single Post
Old 01-31-2012, 02:01 PM   PM User | #1
TheIntern
New Coder

 
Join Date: Jan 2012
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
TheIntern is an unknown quantity at this point
Object 'Exists' function

I am tasked with making a function that can accept many different items and return whether or not they exist.

Currently I am struggling on seeing if an object that holds all the methods for a button exists. I thought I could pass in the string name of the object then do a $('buttonObject').length >0 in the 'Exists' method to see if it was created yet. However this will never return true, and I cannot pass in the object into my exists function without it being created yet (throws error). So something like Exists(buttonObject) won't work, I'll have to pass in the string name of it (Exists('buttonObject')) or something else (I'm new to JS).

So how do I go about testing whether or not it exists if I cannot pass in buttonObject, without quotes?
TheIntern is offline   Reply With Quote