ive been messing round with this for hours and im pulling my hair out at it. How do I return var a from myFunction to allow it to be set as var b which and then display the value of b in the alert message? Thanks! :)
function myFunction(arg)
{
var a;
GM_xmlhttpRequest({
method:"GET",
url:"http://site.com/arg?" + arg,
headers:{
"User-Agent":"monkeyagent",
"Accept":"text/monkey,text/xml",
},
onload:function(details) {
a = details.responseText;
}
});
return a;
}
b = myFunction("blabla");
alert(b);
When I tried it returned just a blank message.