E
E
EVOSandru62015-10-27 12:28:02
JavaScript
EVOSandru6, 2015-10-27 12:28:02

How to make return in $.ajax on jquery?

Good afternoon,

Such a problem, Return from the success block in $.ajax does

not work

$('.link').click(function(e)
{
   e.preventDefault;
   var bool;
$.ajax({
     ...
    success : function(data)
   {
         if(data == 'true') 
            bool = true;
         else
         {
             bool = false;
             return false;
         }
   }
     ...
})
alert(bool);
})


Unfortunately, neither return nor assignment to a variable from the ajax

area is processed . Help with advice!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2015-10-27
@EVOSandru6

async

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question