How can I get my values from json_encode with a callback function
data({
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
});
I want to get the values of my response body so that I will know if there's an error using PHP. I need to have a callback function to easily get my values via javascript.
getThis({"data":"1234"});is JavaScript, not JSON, so obviouslyjson_decodewon't work. What are you trying to do exactly?