<script>
const add_image = async (url) => {
await new Promise(resolve => {
const img = document.createElement('img');
img.addEventListener('load', resolve);
img.src = url;
document.body.appendChild(img);
});
}
const add_text = (text) => {
const paragraph = document.createElement('p');
paragraph.innerHTML = text;
document.body.appendChild(paragraph);
}
</script>