@James
Thanks for this. This is why actually never use 'instanceof' myself.
I always rely on :
Object.prototype.toString.call(Function()) === "[object Function]"
same as jQuery, prototype.js, Dojo, etc ...
Inspired bu recent "isObject" discussion here I have posted this :
http://dbj.org/dbj/?p=270
Where I have presented a little framework and (hopefully) clarified
the terminology, too ...
Althouhg over there I have decided to ignore this IE issue , which I
am hopefully solving here..
I should really stop posting while working, so here is V3 ;o)
( function () {
// GPL (c) 2009 by DBJ.ORG
isFunction = typeof (top.alert) === "object"
? /* IE will use this */
function(x) {
switch (typeof x) {
case "function" : return true ;
case "object" : return (x + "").match(/
function/) !== null ;
default : return false ;
}
}
: /* non IE browsers use only this */
function (x) {
return Object.prototype.toString.call(x) === "[object
Function]" ;
}
})()
--DBJ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---