Techy Techy - 11 months ago 35
Ajax Question

How to get a particular field value from json response

I am trying to call an external API system from my website.In the ajax response,I get the following data.

object(stdClass)#3 (3) {

string(7) "success"
object(stdClass)#4 (3) {

string(113) ""

string(115) ""


I need to get the value of the
field from this response.So that I can redirect page with the url from that field.I have tried with the following code.

type: "POST",
url: path,
data: "email=" + $("#email_data").val() + "&fname=" + $("#fname_data").val()+"&grade="+$("#gradeID_data").val()+
success: function(message){
$(message).map(function(item){console.log (;});

This is not working for me and giving me the following error

Error: Syntax error, unrecognized expression: object(stdClass)#3 (3...

Answer Source

You need to json encode the response from the api call

$response = $api->call($params[,...]);