Below is a HTML fragment that you could include in a web page to include recent articles titles for the person id Newman-D-K based on the JSON version of the feed.
<div id="recent-articles">
Recent articles go here if JavaScript worked!</div>
<script src="https://feeds.library.caltech.edu/scripts/CL.js"></script>
<script>
let recent_articles = document.getElementById("recent-articles");
.getPeopleJSON("Newman-D-K", "recent/article", function(articles, err) {
CLif (err != "") {
console.log("ERROR", err);
return;
}.forEach(function(article) {
articlesvar elem = document.createElement("div"),
= document.createElement("h1"),
h1 = document.createElement("a"),
anchor = document.createElement("div");
div /* Setup to style our elements with CSS classes */
.classList.add("article");
elem.classList.add("article-title");
h1.classList.add("article-abstract");
div/* Not layout our data in our elements */
.setAttribute("href", article.official_url);
anchor.innerHTML = article.title;
anchor.appendChild(anchor);
h1.innerHTML = article.abstract;
div.appendChild(h1);
elem.appendChild(div);
elem/* Finally add our composit element to the list */
.appendChild(elem)
recent_articles;
});
})</script>
That example is rendered below–
See Recent Articles go here if JavaScript worked!