braces identify the object as follows:
timObject = { property1 : "Hello", property2 : "MmmMMm", property3 : ["mmm", 2, 3, 6, "kkk"], method1 : function(){alert("Method had been called" + this.property1)} };
in jQuery, they are used to provide the object with options for your method. You can also write your code like this xxx.css("width","10px").css("font-size","30px"); But by passing it, Object makes it faster and more readable.
xxx.css({"width":"10px","font-size":"20px"});
mas-designs Mar 14 '12 at 9:27 2012-03-14 09:27
source share