In the following code, it should log the data from the link, but it is logging undefined. I believe the problem may be with the scope, here is my code, thanks.
function getData(link) {
var string;
$.get(link, function(data) {
string = String(data);
})
return string;
}
console.log(getData("http://www.industus.com"));