If for example, I have some jQuery doing something simple like:
$("div").fadeIn('fast');
$("div").html('Foo');
That would fade in the div, and set its html to "Foo" whilst it's still fading in, whereas:
$("div").fadeIn('fast',function(){
$("div").html('Foo');
});
Will only set the html to "Foo" after the div has completed fading in.
Is this sort of thing the way JavaScript works in general? So if I had:
//do something
var i = 42;
var foo = i/1;
//do something else
var bar = fooBar();
Will it start doing something else whilst it's still doing something, or will it wait patiently for do something to finish before it does something else?