Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myRequest = new Request('hidden from nohusuro')
- var myInit = {
- method: 'GET',
- mode: 'cors',
- cache: 'default'
- };
- async function getData() {
- const response = await fetch(myRequest, myInit);
- return await response.json();
- }
- window.onload = function () {
- getData().then(batch => {
- buildPage(batch);
- })
- }
- function buildPage(batch) {
- const parsedJSON = batch.map(e => JSON.parse(e.data))
- container.append.apply(container, parsedJSON.map(value => {
- var obj = document.createElement('div');
- obj.textContent = value.item[0].name;
- return obj;
- }));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement