Imagine my JSON data with 3 different sets of information:
[
{
"Pair":"",
"Id":"8ca2df56-2523-4bc3-a648-61ec4debcaaf",
"PubDate":"/Date(1463775846000)/",
"Provider":null,
"Market":""
},
{
"Pair":"",
"Id":"74b2d7c7-bc2c-40ee-8245-7c698befa54d",
"PubDate":"/Date(1463775247000)/",
"Provider":null,
"Market":""
},
{
"Pair":"",
"Id":"0ee3cd96-1df8-49ba-b175-7a75d0840973",
"PubDate":"/Date(1463773687000)/",
"Provider":null,
"Market":""
}
]
Here is what I have already tried:
JQUERY
$.ajax({
type: 'GET',
url: 'news.json',
data: { get_param: 'value' },
dataType: 'json',
success: function (data) {
console.log(data);
$.each(data, function(index, element) {
$( ".content-news h3" ).append( data[0].Title );
/** Stuck Here and it only call 1 data but i already use each function **/
});
}
});
HTML
<div class="news">
<div class="ano">
<div class="content-news">
<h3 id="jtitle"> **/** I Want to Show Id Here **/** </h3>
<h4 id="jprovider" class="author">**/** I Want To Show PubDate **/**</h4>
<p id="jsummary">
**/** I Want to Show Provider Here **/**
</p>
<div class="img-head" id="img-container">
<!-- <img src="" alt="img" class="img-responsive">-->
</div>
</div>
<div class="social-control">
<div class="head-control">
<p id="jdate" class="inline gray"></p>
<a href="#"><p class="pull-right">show more</p></a>
</div>
<div class="clear"></div>
<div class="footer-control">
<p><a href="#"><i class="ion-ios-heart ion-spacing"></i>20</a></p>
<p><a href="#" data-toggle="modal" data-target="#myModal"><i class="ion-chatbox ion-spacing"></i>2 comments</a></p>
<p><a href="#"><i class="ion-android-share-alt ion-spacing"></i>share</a></p>
</div>
</div>
</div>
</div>
I am currently only able to display one result. Can anyone provide hints or tips on how to properly template jQuery using JSON? I appreciate any guidance. Thank you.
At the moment, I am only getting results for one set of data displayed: https://i.sstatic.net/ZIXtQ.png