Karthik Karthik - 1 year ago 87
Javascript Question

Split json data from json array in jquery

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

Object {
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

Answer Source

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);