JSFiddle - React, Tailwind, and code Playground
by matt_bernhardt
HTML
<div id="file_news_stream">
</div>
<p>Hello</p>
JavaScript
alert('hi');
$.get("http://libraries.mit.edu/sites/news/category/subject-areas/scholarly-communication/feed/", function(data){
alert('getting html...');
var i = 1;
$('item',data).each(function(){
var itemTitle = $(this).find('title').text();
if(i<3 && itemTitle.slice(0,11)=='OA research'){
var itemLink = $(this).find('guid').text();
var itemDesc = $(this).find('description').text();
$('#file_news_stream').append('<p><a href="'+itemLink+'">'+itemTitle.slice(25,99)+'</a></p><p>'+itemDesc+'</p>');
i++;
}
})
});