php - Pass a variable from a get query in javascript -
i trying pass value of parameter outside $.get
jquery in javascript. read should somehow in synchronous mode couldn't find solution.
here code:
var flag; var t = $.get("mutalyzer.php?id="+variation.value, function(data) { flag=data; }); document.write(flag);
where undefined result.
thanks!
write inside callback function
try this
var t = $.get("mutalyzer.php?id="+variation.value, function(data) { //this callback function , runs when gets completed flag=data; document.write(flag); });
Comments
Post a Comment