tests whether an object is a function

Description

.isFunction() tests whether an object is a function. Make sure not to use parentheses in the function name.

Example


<!DOCTYPE html> 
<html>
<head> 
    <script src="http://yourServer.com/jQuery/jquery.min.js"></script> 
    <script> 
        console.log($.isFunction({})); // false
        console.log($.isFunction($.isFunction)); // true
        console.log($.isFunction($.isFunction())); // false, because of parenthesis
<!-- ww w . j  a  v a  2s  .  c o m-->
    </script> 
</head> 
<body> 
  <p>Your tags here</p>
</body> 
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Tutorial »




Basics
Selector
DOM
Event
Effect
Utilities