jquery exit function in ajax call
- by Raphappa
I have a javascript function.
and in there, I insert a ajax call function using jquery.
depends on ajax call result,
I want to exit hi function.
is there anyway to do this?
function hi()
{
$.ajax({
url: "/shop/haveItem",
type: "GET",
async:false,
success: function(data){
if(data == '1')
//exit hi() function
}
});
//some executable code when data is not '1'
...
}