Check if object exists


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function isValidObject(objToTest) {
  2. if (null == objToTest) return false;
  3. if ("undefined" == typeof(objToTest)) return false;
  4. return true;
  5. }

URL: http://tech.chitgoks.com/2008/06/30/javascript-check-if-object-is-valid/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.