summaryrefslogtreecommitdiff
path: root/js-scripts/queryJsonPlaceholder.js
blob: dd6e21e4e0ff28b1a66826d5f60edfd884158e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Testing to see if I can make API calls on a site that has CSP headers. However,
// this certain site does not have those headers on their error page, so by creating
// an iframe on the document root with the error page we can make an api call to another
// service, maybe?

// Old-school callback hell being forced upon me rn
function fetchTodos(callback) {
  fetch('https://jsonplaceholder.typicode.com/todos')
    .then(response => response.json())
    .then(callback)
}