0

I'm getting a JsonArray like this, by using urlrequest method in jquery

Object {
code:"INR"
price:"14999"
status:"sucess"
qty:"5"
title:"Moto G Plus, 4th Gen (Black, 32 GB)"
}

Now i need to print, certain jsonarray values, using jquery like this

title - Moto G Plus, 4th Gen (Black, 32 GB)
price - 14999
1
  • 5
    You need to print? Do it, what's the problem? Commented Jul 30, 2016 at 13:32

2 Answers 2

2

If you want print each key and value in your json object use this method. json in the function should be you json object. Key and value is your id and value.

$.each(json, function(key,value){
            alert("output: "+key+" value "+value); 
            });
Sign up to request clarification or add additional context in comments.

Comments

0

If you want to loop through the properties of the object you can use the keys method that returns the properties of the object and access the object propertywith the dot notation or the [] notation.

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.