$.ajax callback function is inside another function
<p>I am having one function which will be called when ever my custom controls get loaded. please refer below code.</p>

<pre><code>function load()
{
getdata();
}

function getdata()
{

  $. ajax({
 url://remote url,
type:"get",
success:function(data)
{
//going to set the data to my control
}

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

<p>so success callback function takes some time to return the "data" (i.e fetch the data from remote URL) but load() client side method gets completed and do our control rendering. so i want  load() method needs to  wait until success function return the data from remote URL and then load() function get completed then i will render our control based on the data.</p>

<p>how to do load() function need to wait the callback gets completed.</p>

<p>Thanks,</p>

<p>Siva</p>
