Latest: buggy behaviour of parent:: in PHP 5.3.3

Content with Style

Web Technique

Checking for object literals

by Pascal Opitz on October 3 2006, 07:46

Such a basic thing to do, but still, I didn’t have to do it until now:
Checking if an object literal is defined.


var my_object_literal
{
  'my_property' : 'I exist'
};

if (window.my_object_literal)
{
   alert(my_object_literal.my_property);
}

via FAQTS

Comments

Don't miss the opportunity to leave the first comment.

Leave your comment

Comments are moderated.
Tags allowed: a, strong, em, code, ul, ol, li, q, blockquote, br, p

Advertisement
Advertisement