jQuery function not able to get values unless an alert is written
<p>I have </p>

<pre><code>   $j("input[id^='tab_name_edit']").each(function(){

    var divcnt = $j(this).attr('id');

    var divcnt = divcnt.split(/[_]/);
    nosoftabs = divcnt[divcnt.length-1];


        var tabnm1 = $j(this).val();
        addInputGroup(tabnm1);
        automateDynamicFields(nosoftabs);


    });


function automateDynamicFields(nosoftabs){
    //alert('No the value of nosoftab is recieved and the function works perfectly.')
    $j("input[id^='registration_label"+nosoftabs+"']").slice(0,-1).each(function(){
            add_tier($j('#dynamic_registration_url'+nosoftabs),'dynamic_registration_label',dynamic_registration_url_hn,nosoftabs);
        });
}
</code></pre>

<h2>What I have.</h2>

<p>A function calling another function and passing a value <code>nosoftabs</code>. This value is recieved and the <code>function automateDynamicFields</code> works perfectly when i write Alert in it.</p>

<p>I know this has to do something with DOM elements not being ready. Is there any way to check if a <code>variable</code> is loaded in jQuery. I know using <code>$('myDiv').load(....)</code> this may be fixed, but curious to know if it can be done while putting a check on the variable load and only when it loads, it should be passed to the next function. </p>
