Skip to content

Commit

Permalink
testing js call
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoamaral committed Aug 12, 2021
1 parent 6a67e73 commit 1df8df1
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions content/observatorio/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Observatorio"
date: 2021-08-12T15:33:35+01:00
lastmod:
author: Bruno Amaral

description:
categories: []
tags: []

draft: false
enableDisqus : true
enableMathJax: false
disableToC: false
disableAutoCollapse: true
---

Esta página tem uma secção para cada uma das terapias listadas como relevantes pela [MS Society](https://www.mssociety.org.uk/research/explore-our-research/emerging-research-and-treatments/explore-treatments-in-trials).

Em cada secção, são listados os ensaios clínicos e artigos publicados em que o fármaco consta do título.

<ul></ul>

<script>
const myList = document.querySelector('ul');
const myRequest = new Request('https://api.brunoamaral.net/articles/relevant');

fetch(myRequest )
.then(response => response.json())
.then(data => {
for (const product of data.products) {
let listItem = document.createElement('li');
listItem.appendChild(
document.createElement('strong')
).textContent = product.Name;
listItem.append(
` can be found in ${
product.Location
}. Cost: `
);
listItem.appendChild(
document.createElement('strong')
).textContent = `£${product.Price}`;
myList.appendChild(listItem);
}
})
.catch(console.error);
</script>

0 comments on commit 1df8df1

Please sign in to comment.