when I check the log from Console using chrome browser, I keep getting sideType
is undefined. It is not returning data to sideType
variable.
when I put console.log(sideType);
in the sideGroupData()
function - it work fine without problem.
Code:
function sideGroupData(GroupID) {
$.getJSON("group_data.php",{GroupID:GroupID}, function(j){
return j;
});
}
function reloadProduct(productID) {
$.post("product.php", { productID:productID }, function(data) {
var sideType = sideGroupData(123);
console.log(sideType);
});
}
reloadProduct(999);
title