I am getting ajax response in array format from php url. How to extract array response values in jQuery? FYI:
PHP阵列:
$response = array( msg => Hello , html => <b>Good bye</b> );
我正在从我的阿贾克斯对策中找到应急阵列。 i.e.
var promo = "promo=45fdf4684sfd";
$.ajax({
type: "POST",
url: baseJsUrl + "/users/calc_discount",
data: promo,
success: function (msg) { // I am getting $response here as ajax response.
//alert(msg);
// Here I want to check whether response is in array format or not. if it is in array format, I want to extract msg here and want to use response array values.
}
});
Let me know answer pls. Thanks.