how to handle two function
<p>I have two funtions <code>searching</code> and <code>searchhistory</code>. Currently these two function are running in my code but the value of <code>nbofimages</code> is not updated. </p>

<p>Also it's showing only one alert message after searchhistory function is completed.</p>

<pre><code>$.when(searching(searchkwd, check_st, check_sf, '31', '1', filter, ori, colorcheck))
 .then(searchhistory(user_search,search_pars,search_username,nbofimages));

var nbofimages;

function searching(searchkwd, check_st, check_sf, '31', '1', filter, ori, colorcheck)
{
    nbofimages = "3";
    alert(nbofimages);
}

function searchhistory(user_search,search_pars,search_username,nbofimages)
{
    alert(nbofimages);
}
</code></pre>
