Avatar of Rozamunda
Rozamunda
 asked on

asynch false not working

Hi , What am I doing wrong here ?

what is  inside success is returned but outside returns undefined value

 
   	   function getfromto(starts,ends)
   	   {  
   		  var select;     		   
   		   var ft = 
			'from=' + starts + '&to=' + ends; 
   		
		$.ajax({
			 url:'lft.php',					
			 type:'GET',
			 asynch: false,
		     data: ft, 
			  success: function(data)	
			  {		   							  
					select =  data;    							
					  console.log(select);	
					}  
			});
		
		  console.log(select);		
		  return select; 
   	     }

Open in new window

JavaScript

Avatar of undefined
Last Comment
leakim971

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61