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.
<div><span class="gmail_quote">On 9/25/07, <b class="gmail_sendername">Danjojo</b> <<a href="mailto:dlcacuff@gmail.com">
dlcacuff@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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
}
});
});
</blockquote></div>