[jQuery] $(function()
[jQuery] $(function()
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
}
});
});