Untitled

mail@pastecode.io avatar
unknown
javascript
a month ago
499 B
2
Indexable
Never
document.addEventListener('DOMContentLoaded', async function () {
    try {
        const response = await fetch('/get-logo');
        if (!response.ok) {
            throw new Error('Network response was not ok');
        }
        const data = await response.json();
        const baseUrl = window.location.origin;
        document.getElementById('dynamic-logo').src = `${baseUrl}${data.logoUrl}`;
    } catch (error) {
        console.error('Error fetching logo:', error);
    }
});
Leave a Comment