javascript inline callback function to separate function
<p>Why is this code working:</p>

<pre><code>function onCordovaReady() { 
    navigator.globalization.getLocaleName(function (locale) {
        jQuery.i18n.properties({
            name:'message', 
            path:'lang/', 
            mode:'map',
            language:locale.value,
            callback: function(){
                alert(locale.value);
                alert(jQuery.i18n.prop('msg_hello'));
                alert(jQuery.i18n.prop('msg_complex', 'John'));
            }
        });
    });
}
</code></pre>

<p>And this one not:</p>

<pre><code>function onCordovaReady() { 
    navigator.globalization.getLocaleName(function (locale) {
        jQuery.i18n.properties({
            name:'message', 
            path:'lang/', 
            mode:'map',
            language:locale.value,
            callback: onLanguageReady(locale)
        });
    });
}

function onLanguageReady(locale) {
     alert(locale.value);
     alert(jQuery.i18n.prop('msg_hello'));
     alert(jQuery.i18n.prop('msg_complex', 'John'));    
}
</code></pre>

<p>I want to make the callback in a different function so my code will look cleaner, but couldn't get it to work. The first alert will work (it will display nl_NL), but the second and third alert will output [msg_hello] and [msg_complex].</p>

<p>Many thanks!</p>
