Since the $.get() method is asynchronous, the getText() function wasn't able to get a return value in the time that the $.get() method finished running. Is there a similar method that's like a synchronous version of the $.get() method?
var text = getText("https://www.google.com/search?q=search");
console.log(text);
function getText(url) {
$.get( url, function( data ) {
return data;
});
} //end of function getText(URL)
Returns: undefined