var POS = {
PriceLookUp: function (SKU) {
$.ajax({
type: 'GET',
data: 'SKU=' + SKU,
url: '@Url.Action("GetProduct", "POS")',
success: function (data) {
if (data["found"] == "true") {
var price = data["price"];
alert(price);/// this works
return price;
}
else {
alert("Item could not be found.");
return;
}
},
error: function (req, status, errorObj) {
alert(errorObj.toString());
}
});
}
}
if have this function it always returned "undefined" i tried testing it with alert()... the result was correct
why is my function always returned "undefined"?