Hi Everyone,
I have no idea what's going on here and was hoping someone could help, I'm sure it's something easy going on that I'm just missing.
I have a function in javascript that has a JQuery post inside of it. I would like to return the results of the post which is just text and put it in a variable. The number is coming back correctly from the Post but when I put it in the variable, the variable says "undefined". Any ideas?
var total = GetTotalSize();
alert(total);
function GetTotalSize(){
var i = "";
$.post("Handlers/GetTotal.ashx", {id : $("#hID").val()}, function(data){
i = data.toString();
return i;
});
}