I need to grab the value from a route using $.get. I got it but I cannot wait up to all the others functions be finished to return the value.
function myFunction(str) { // str is my word to be searched.
var obj = {str};
$.get('/pronunciation/words'+'?'+$.param(obj), function( data ) {
// I would like to pass data straightway after the line above.
return data;
});