Check whether an object contains any properties

Description

.isEmptyObject() tests whether an object contains any properties, including inherited properties, independent of object type:

Example


<!DOCTYPE html> 
<html>
<head> 
    <script src="http://yourServer.com/jQuery/jquery.min.js"></script> 
    <script> 
         console.log($.isEmptyObject("")); // returns true
         console.log($.isEmptyObject({})); // returns true
         <!--from   www  . jav  a  2  s  . com-->
         var  developer =  {};
         developer.bugs =  100
         console.log($.isEmptyObject(developer)); // returns false

    </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