function isDefined()


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



Copy this code and paste it in your HTML
  1. //Versión reducida (Gracias DN)
  2.  
  3. function isDefined( variable) { return (typeof(window[variable]) != "undefined");}
  4.  
  5.  
  6.  
  7. //Uso:
  8.  
  9. isDefined("nombre_variable");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.