$.ajax({
type: "GET",
dataType: 'jsonp',
url: 'https://wiljcr.blogspot.com/feeds/posts/default/5158425934439969382?alt=json-in-script',
success: function(data) {
var entry = data.entry;
$(entry).each(function() {
content = this.content.$t;
myArray = {};
$.each($(content), function() {
var getClass = $(this).attr('class');
myArray[getClass] = $(this).find("li").map(function() {
return $(this).text();
}).get()
});
console.log(myArray);
});
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
{
am: ["gud am", "good morning"],
greetings: ["hi", "hello", "hey"]
}
Desired output:
[
am = ["gud am", "good morning"],
greetings = ["hi", "hello", "hey"]
]
Thanks for your help...
[ am = ["gud am", "good morning"], greetings = ["hi", "hello", "hey"] ]is not the output of that[ am = [isn't a multi-dimensional arraymyArray=[];usingmyArray.push($(this).find("li").map(function() {$(this).text()}).get())is the closest you can come using array