You can do (typeof myObj == 'undefined') and I think you can also do (myObj == undefined) thanks to the completely mind-blowing line of code at the beginning of jQuery window.undefined = window.undefined;
-blair Daemach wrote: > I want to create a global object to store some settings in, but only if it > doesn't exist already. If it doesn't exist and I try to use something like > if (myObj == 'undefined') myObj = new Object(); I get an error saying the > object is not defined. > > Yeah I should know stuff like this ;) _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/