Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloodinaz authored Jun 15, 2024
1 parent d6ac6da commit c298127
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
function loadHTML(elementId, url) {
fetch(url)
.then(response => response.text())
.then(data => {
document.getElementById(elementId).innerHTML = data;
})
.catch(error => console.log('Error loading HTML: ', error));
}
loadHTML('header-placeholder', 'https://kaloodinaz.github.io/header.html');
loadHTML('footer-placeholder', 'https://kaloodinaz.github.io/footer.html');
loadHTML('catalog-placeholder', 'https://kaloodinaz.github.io/catalog.html');
loadHTML('social-placeholder', 'https://kaloodinaz.github.io/social.html');


//load iframe js
var iframe = document.getElementById("iframehtml5");
Expand Down Expand Up @@ -129,3 +116,17 @@ function share() {
console.log('Copied link');
}
}

function loadHTML(elementId, url) {
fetch(url)
.then(response => response.text())
.then(data => {
document.getElementById(elementId).innerHTML = data;
})
.catch(error => console.log('Error loading HTML: ', error));
}
loadHTML('header-placeholder', 'https://kaloodinaz.github.io/header.html');
loadHTML('footer-placeholder', 'https://kaloodinaz.github.io/footer.html');
loadHTML('catalog-placeholder', 'https://kaloodinaz.github.io/catalog.html');
loadHTML('social-placeholder', 'https://kaloodinaz.github.io/social.html');

0 comments on commit c298127

Please sign in to comment.