Jquery trigger event appends content but DOM not ready after
<p>I'm struggling with something that i think would be simple. I know that i've had the same problem in plain old javascript without JQuery before. What i try to do is:</p>

<pre><code>//When the postal code blurs, lookup the city, country, province
$('#codePostal').blur(function(){
    $.get('/fr/radio-telethon/ajax_code_postal.php', {code_postal: $('#codePostal').val()}, function(data){
        if(data.code_postal.toLowerCase() == $('#codePostal').val().toLowerCase()){
            $('#ville').val(data.ville);
            $('#pays').val(data.pays);
            $('#pays').trigger('change');
            $('#province').val(data.province);
            $('#province').trigger('change');
        }
    });
});
</code></pre>

<p>This basically calls a postalcode lookup script and returns an object with the data. The data itself is correct, i can alert it and it shows fine. The problem is that the change trigger on #pays (country in english) reloads the information inside #province (state) and it seems like the DOM is strugling and not loading the info.</p>

<p>If i alert between the the trigger on the country and the val on the province, i can set the province correctly. The method i use to add provinces to the province box is the following: </p>

<pre><code>//Empty the provinces
$('#province').empty();

//Get the new data
$.get('/include/radio-telethon/formulaire-ajax.php', {pays: code}, function(data){

    //Loop the items
    for(i in data.options){
        $('#province').append('&lt;option value="'+data.options[i].value+'"&gt;'+data.options[i].label+'&lt;/option&gt;');
    }

    //Setup the label
    $('#labelProvince').html(data.label);

});
</code></pre>

<p>So my guess is that APPEND is messing up everything and making the whole DOM linger and thats why i can't seem to do $('#province').val(data.province);</p>

<p>Is it me? Or is there a magic trick i can't seem to find...</p>
