Added new function-testing code that is completely cross-browser compatible.
This commit is contained in:
parent
e45dbf29f8
commit
b81ea5f9ba
5
src/jquery/jquery.js
vendored
5
src/jquery/jquery.js
vendored
|
@ -1222,8 +1222,11 @@ jQuery.extend({
|
||||||
$ = jQuery._$;
|
$ = jQuery._$;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// This may seem like some crazy code, but trust me when I say that this
|
||||||
|
// is the only cross-browser way to do this. --John
|
||||||
isFunction: function( fn ) {
|
isFunction: function( fn ) {
|
||||||
return fn && typeof fn == "function";
|
return !!fn && typeof fn != "string" &&
|
||||||
|
typeof fn[0] == "undefined" && /function/i.test( fn + "" );
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue