0

I have a ajax function and i called that function in another place.But Before success function fires execute the next line in the call place.

Ajax Call

    function NewsLoadNumber(news) {
    $.ajax({
        // ...
        success: function(number) {
           alert("abc"); <-- thisone fires after.
           return number;
        }
    });
}

and then i called this function in another place,

var number = NewsLoadNumber(news);
alert(number); <-- This one fires first as undefined
TechGuy
  • 4,298
  • 15
  • 56
  • 87

0 Answers0