I\'m trying to call a function that contains jQuery code. I want this function to return the results of the jQuery statement. It is not working, and I\'m trying to figure ou
Looks like you want synchronous request: How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?
Or, you may want to pass callback to your function:
function showGetResult (name, callback) {
var scriptURL = "somefile.php?name=" + name;
return $.get(scriptURL, {}, callback);
}
showGetResult("John", function(data){ alert(data); });