Hi
I am working on displaying json data in ul li with href, i can able to print only
but my expected output should be as below
<script type="text/javascript">
var data= {"query":{"simple_query_string":{"query":"A*"}}};
$.ajax({
type: 'POST',
//url: 'data.json',
url: 'urllink',
dataType: 'json',
success: function (data) {
arr= data.hits.hits;
$.each(arr, function( index, value ){
t='<li><a href="#'+value._id+'" data-toggle="tab">'+value._source.title+'</a></li>' ;
console.log(t);
// t=value._source.title;
$('#metric_id').append($('<ul>' ,{
text:t
}));
});
},
});
</script>
<div id="metric_id"></div>
Please help me to fix the issue.