Delay ajax success, jQuery
<p>I got stuck on something simple. When I make an ajax request, by some how it doesn't have enough time to make assignment to <code>combonews</code> variable:</p>

<pre><code>jQuery.ajax({
            type: "POST",
            url: "People.aspx/LoadComboNews",
            data: "{\"id\":" + usrid + "}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (msg) {
                // Replace the div's content with the page method's return.
                combonews = '';
                setTimeout(function () { combonews = eval(msg.d); }, 500);
                //combonews = eval(msg.d);

            }
    });
</code></pre>

<p>tried to add setTimeout as shown, but still when I want to alert <code>combonews</code>  it's empty.
When I alert <code>msg.d</code> it's always have data ready. 
Is there a way to extend the time for <code>combonews = eval(msg.d);</code> to be perfomed?</p>

<p><strong>UPDATE:</strong></p>

<p>When I run it by binding to button click event, the assignment works fine </p>

<p><strong>---------------------------------------</strong></p>

<p><strong>UPDATE2</strong></p>

<pre><code>function lcombo() {
    jQuery('#combostart ~ option').remove();
    //setTimeout((function () {
        jQuery.ajax({
            type: "POST",
            url: "People.aspx/LoadComboNews",
            data: "{\"id\":" + usrid + "}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            complete: function (msg) {
                // Replace the div's content with the page method's return.
                combonews = '';
                //setTimeout(function () { combonews = eval(msg.d); }, 500);
                combonews = JSON.parse(msg.d);

            }
        });
        //combonews = eval(combonews);
        //alert(combonews);
        jQuery(".chzn-select").chosen();
        jQuery(".chzn-select-deselect").chosen({ allow_single_deselect: true });
        var str = "";
        if (combonews.length &gt; 0)
            for (var i in combonews) {
                str += "&lt;option value='" + combonews[i][0] + "'&gt;" + combonews[i][1] + "&lt;/option&gt;";
            }
        jQuery("#combooptions").append(str);
        jQuery("#combooptions").val(draftid);
        jQuery("#combooptions").trigger("liszt:updated"); 
}
</code></pre>

<p>and then I load lcombo() function. which works on click, but doesn't in some other consequences (I mean doesn't load the message to combonews)</p>

<p>THanks you</p>
