|
1 |
| -request("https://corporatebs-generator.sameerkumar.website/", function(response) { |
2 |
| - const sentence = document.querySelector('.sentence'); |
3 |
| - let p = document.createElement('p') |
4 |
| - p.textContent = response.phrase; |
5 |
| - sentence.appendChild(p); |
6 |
| -}); |
7 |
| - |
| 1 | +// request("https://corporatebs-generator.sameerkumar.website/", function(response) { |
| 2 | +// const sentence = document.querySelector('.sentence'); |
| 3 | +// let p = document.createElement('p') |
| 4 | +// p.textContent = response.phrase; |
| 5 | +// sentence.appendChild(p); |
| 6 | +// console.log("TEXT") |
| 7 | +// }); |
8 | 8 |
|
9 | 9 | const pages = Math.floor(Math.random() * 10);
|
10 | 10 |
|
11 |
| -request(`https://picsum.photos/v2/list?page=${pages}&limit=100`, function(response) { |
12 |
| - const image = document.querySelector('.image'); |
| 11 | +request(`https://picsum.photos/v2/list?page=${pages}&limit=100`, function( |
| 12 | + response |
| 13 | +) { |
| 14 | + const image = document.querySelector(".image"); |
13 | 15 | const random = Math.floor(Math.random() * 100);
|
14 |
| - image.src = response[random].download_url |
| 16 | + |
| 17 | + image.src = response[random].download_url; |
| 18 | + image.addEventListener("load", () => { |
| 19 | + console.log("IMAGE loaded"); |
| 20 | + request("https://corporatebs-generator.sameerkumar.website/", function( |
| 21 | + response |
| 22 | + ) { |
| 23 | + const sentence = document.querySelector(".sentence"); |
| 24 | + let p = document.createElement("p"); |
| 25 | + p.textContent = response.phrase; |
| 26 | + sentence.appendChild(p); |
| 27 | + console.log("TEXT"); |
| 28 | + }); |
| 29 | + }); |
15 | 30 | });
|
0 commit comments