0

Read json data value.
Getting the following result(json encoded)

    [{"client_id":1,"client_first_name":"Pooja"}]null

    how can i read "client_first_name" value. 
        $.ajax({
                    type: "POST",
                    data: {id: clientid},
                    dataType: 'json',
                    url: webURL + "/invoice/clientdetail/",
                    success: function(data)
                    {
                        var res = json_encode(data);

                    }
            });

 how can i read "client_first_name" value 

*data- getting json array, how can i read particular value.

2 Answers 2

2

Assuming that your "res" jSON looks something like this:

{"client_first_name":"value"}

You are reading the value in this way:

res[0]['client_first_name']

Please reffer to:

how to get data to javascript from php using json_encode?

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

Comments

0

Use this to get client first name

res[0]['client_first_name']

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.