How can I check my Image object type?
3 answers
You should avoid explicit type checking.
Use polymorphism to choose what to do with images and what to do with other objects.
var img = $(new Image())(...);
img.process = function(){ ... do whatever images need ... };
objs.push( img );
var txt = new Text();
txt.process = function(){ .. do text processing, spellcheck, ... };
objs.push( txt );
...
objs.each( o ) { o.process(); }
-1
source to share