Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fetch api javascript

fetch('https://picsum.photos/600/300')
    .then(res => res.blob())
    .then(blob => {
        let img = document.createElement('img');
        console.log(img);
        img.src = URL.createObjectURL(blob);
        document.body.appendChild(img)
        docuemnt.querySelector('body').appendChild(img);
    });
Source by careerfoundry.com #
 
PREVIOUS NEXT
Tagged: #fetch #api #javascript
ADD COMMENT
Topic
Name
3+8 =