jquery core: closes #2968. Simplified isFunction, dropping support for DOM methods and functions like alert() on IE.

This commit is contained in:
Ariel Flesler 2008-07-23 16:18:05 +00:00
parent 43c4b64f32
commit 69212c501f
2 changed files with 8 additions and 5 deletions

View file

@ -613,9 +613,10 @@ jQuery.extend({
},
// See test/unit/core.js for details concerning this function.
// Since 1.3 DOM methods and function like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( fn ) {
return !!fn && typeof fn != "string" && !fn.nodeName &&
fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
return fn instanceof Function;
},
// check if an element is in a (or is an) XML document