Hi there, I have been going through the jQuery guides on w3schools and came to a point where I wondered about the conventions for different brackets used in the guides. http://www.w3schools...ery_effects.asp Up until the section on jQuery Custom Animations, all function defitions were written like: $(selector).fadeTo(speed,opacity,callback) where no brackets were placed around the parameters for functions. For the animate() function, this changed: $(selector).animate({params},[duration],[easing],[callback]) At first I thought this meant the guide was detailing that the parameter params was required by using curly brackets { } and the other three were option using square brackets [ ].But then as I read on, I noticed the code had the curly brackets in it:
<script type="text/javascript">$(document).ready(function(){ $("button").click(function(){ $("div").animate({height:300},"slow"); $("div").animate({width:300},"slow"); $("div").animate({height:100},"slow"); $("div").animate({width:100},"slow"); });});</script>
So then I wondered, why are the square brackets there? Are there any conventions used in the w3school guides for syntax like this? I guess maybe not because with many languages a single convention might not fit all? Also, I couldn't find this outlined in the jQuery guide, but when passing arguments to a function, what are the rules in jQuery for using quotes? So far from teh guides the impression I get is, "numbers - don't use quotes. everything else - use quotes." Is this correct?