0
{"status":1,"return":364}

I'm facing problem to getting status and return value in jquery. how I get the single value from this array.

1
  • This is not an array. Its an object :) Commented May 26, 2018 at 9:47

2 Answers 2

1

It is not an array but its an object.

If I am right, you want to get the value of status object. Please see the screenshot attached.

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

I have used data.status but it return: undefined
Why are you using $data ??? Just declare it as var data = {status: “hello”}
I'm getting this code as a response from php file as {"status":1,"return":364} how I can convert this to var data = {status: "1"} ??
php file response means I'm getting response from api
0

finally got the answer:

  var status = data["status"];//prints 1

1 Comment

You can also do var status = data.status;

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.