to know if something is an objet or an string (javascript)

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

to know if something is an objet or an string (javascript)

Post by visonardo »

if i do if(u.length!=0)... i cant, because may be that u is not an objet but is a string and u.length will return me the characters ammount that it has.

how can i know that?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Type detection isn't all that hard...

http://blogs.wdevs.com/Sukumar/archive/ ... /3335.aspx
Post Reply