On Aug 4, 4:34 pm, DBJDBJ wrote:
> V4 ;o)
> Is this not the simplest working solution ?
That must depend on what is meant by "working" and "solution". This
thread does not contain a clear statement of what it is this -
isFunction - function is supposed to do; the discrimination that it is
supposed to make.
> // GPL (c) 2009 by DBJ.ORG
> function isFunction(x) {
> switch (typeof x) {
> case "function" : return true ;
> case "object" : return (x + "").match(/
> function/) !== null ;
> default : return false ;
> }
> }
>
> isFunction( top.alert )
> /*
> true
> */
> isFunction( isFunction )
> /*
> true
> */
With on ordinary object literal as its argument:-
isFunction( {toString:function(){return 'I am not a function';}} )
/*
true
*/
- and on IE:-
isFunction( document.forms.item )
/*
false
*/
- when if - alert - is to be considered a function then the - item -
methods of collections should also be.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---