Could you please help me on how to combine the below Result1 and Result2 JSON objects into single JSON such that i have Name,No,Avg,Subject1,Subject2 into single JSON object. I
See jQuery.extend()
var x = {"Result1":"[{"NAME" : "Mark","No" : "23544","Avg" : "49"}]"}
var y = {"Result2":"[{"Subject1" : "Maths","Subject2" : "Computers"}]"}
var z = jQuery.extend({}, x.Result1[0], y.Result2[0]);
// z.NAME, z.No, z.Avg, z.subject1...
I'm not sure whether you've parsed the JSON string into a JavaScript object yet; but see jQuery.parseJSON() to see how you do this (be aware; parseJSON()
will throw an error if you pass it invalid JSON).