If statement not accepting variable value
<p>I have this code:</p>

<pre><code>meJi = 33;
$.ajax({
type: "POST",
url: mega,
data: string,
beforeSend: function() {
    $('#loading').html("&lt;img src='images/loading.gif'/&gt;").fadeIn('fast');
},
complete: function() {
    $('#loading').fadeOut('fast');
},
success: function(msg) {
    loading_hide();
    f = (msg).length;
    if (f &lt;= 1250) {
        alert("su busqueda no presenta resultados");
        code(3);

        else {
            $("#container").html(msg);
            fdemandados();
        }
    }
});
function code(ig) {
    console.log(img);
    meJi = ig;
}

$("#select_comprobar3").on('click', function(event) {
    tacuba = $("#amazon").val();
    ca = "2";
    dan = "g";
    if (meJi ==3) {
        avisobusqueda2 = $("#avisofiltro").html("zzzFiltro activado Busqueda por la palabra: " + tacuba + " - clic para quitar ").fadeIn('slow');
    } else {}
    if (!tacuba) {
        alert("Debe ingresar una palabra");
    } else {
        lor = tacuba;
        var page = "1";
        loadData(page, dan, lor);
    }
    event.stopImmediatePropagation();
    return false;
});
</code></pre>

<p>the problem is this:</p>

<pre><code>if (meJi==3) {
</code></pre>

<p>I don't know why but meJi variable never changes to 3 so the conditional always assume that meJi is 33.</p>

<p><strong>edit: Im change the conditional part but the problem still exist.</strong></p>
