I have the following function:
function parseLink(link){
var newlink="";
$.get(link,
function(data){
startoffset = data.indexOf("location.replace") + 18;
endoffset = data.indexOf("tiny_fold = 1;") - 8;
newlink= data.substr(startoffset,(endoffset-startoffset));
});
return newlink;
}
I'm using jquery $.get to parse a URL, which works fine if I do it without a function, but the function will return the empty string. Clearly I'm doing something wrong, but I don't know what; any help would be highly appreciated.