View Single Post
Old 12-11-2022, 08:31 PM  
MelkieWey
Hypno Sissy
 
MelkieWey's Avatar
 
Industry Role:
Join Date: May 2022
Location: Europe/Austria
Posts: 273
im the nitwit to continue the cycle

external file with the <head>
<base href="https://gfy.com/" /><!--[if IE]></base><![endif]--> section? WHY?

instead of PHP use .phtml & javascript


unorderly list saved as phtml!

Quote:
<ul>
<li>poo</li>
<li>shit</li>
<li>scat</li>
<li>excrement</li>
<li>diarrea</li>
<li>scheiße</li>
</ul>
Quote:
<script>
//define location & files
const partials = {
shitlist: "./where/is/the/shitlist.phtml",
poolist:"./where/is/the/poolist.phtml",
}
//fetch the content of the files into constants
const fetchContent =async (section) => {
const contentPartial = await fetch(partials[section]);
const content = await contentPartial.text();
return content;
}
//loads section with fetched content
async funtion loadSection(section) {
const dom = document.getElementById(section);
const content = await fetchContent(section);
dom.innerHTML = content;
}
//loads sections from contants
async function main() {
await loadSection('shitlist');
await loadSection('poolist');
}
//final execution
(async function () {
await main();
})();
</script>

Melkanea showed off!
MelkieWey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote