Using a function like that is called an "anonymous" function, and in this
case you are passing the anonymous function to the jQuery object, which
stores it and calls on it when the DOM is finished loading.

On 9/25/07, Danjojo <[EMAIL PROTECTED]> wrote:
>
>
> 2 Questions.
>
> 1. are there the correct number of parenthesis in this code. Is there
> a syntax error? It runs fine..
>
> 2. What is this idea of wrapping the code in like a blank function()
> with no name? The one the looks like $function() ? I don't understand
> it and I want to. Being a noob javascript coder I understand functions
> like:
>
> function myCall() {
> // etc
> }
>
>
> $(function() {
>         $("#languages").bind('change', function() {
>                 var country = $(this).val();
>                 if(country) {
>                         $('#countryFlag').attr("src", "images/" + country
> + ".gif");
>                         $.cookie('language', country, {expires: 7}); //
> set cookie
>                 }
>         });
> });
>
>

Reply via email to