I want to retrieve the values from json
multidimensional array and I wanted to compare the id
from each table. But using $each
loop I am not able to do it. Is there any other method to do it?
My code is:
$(document).ready(function() {
$.ajax({
url : "http://ip/App/xxx/yyy",
type:"GET",
dataType:"json",
data:{param:"no"},
success: function(json)
{
var event1=json.event1;
var media1=json.media;
var DOM=$('#DOM');
var path="http://ip/App/";
$.each(event1,function(key,value)
{
DOM.append("<li><h3>"+value.event_id+"</h3><p>"+value.event_title+
"</p><p>"+value.event_discription+"</p><p>"+
value.event_summary+"</p><p>"+
value.event_start_date+"</p></li>")
});
$.each(media1,function(key,value)
{
DOM.append('<li><p><img src='+path+value.media_path+' alt="" />
</p><p>'+value.media_id+'</p></li>');
});
},
error: function(e){
alert("check ur connection/ip"+e);
}
});
});
I want to compare id
of each array.