function addrewarddb()
{
var rval="98";
$.post("db/mkreward.php",{
proid:getURLParameter("id")
},function(data){
rval="99";
alert(rval);
});
alert(rval);
return rval;
}
when this function executes the function returns 98 instead of 99.the two alerts showing 98,then 99.how to make my function returns 99.i think the problem here is the function returnig before the response from the server page mkreward.php.how i can make the function return after the response from server