1
Français / Re: Possible cache problem
« on: November 11, 2022, 11:50:41 PM »
Thanks for the answers @LeoNeeson, but I found the source of the problem : it was probably a mix of my Javascript bugging and of the URL I used in my second computer.
I used my real IP with the port :80, and I worked to rewrite my JS scripts.
After a simple test with the new URL showing that a simple HTML line was correctly displaying, I started to rework my code.
I found that my second script was not seing the first script DOM modification probably because it was doing it too fast. So I added a pause somewhere (after billions of rewrittings ^^) and it finally worked.
Here's an excerpt of my code if you want just an insight :
At the bottom of my <body>, I call my JS controller :
In my controller :
I made me going crazy for 6 hours, but I finally found the light.
Can't do this for now, I need to complete my work for the next weeks. In a near future, I should share it on Github.
It's a simple HTML that allow to import other HTML in wich I create <article> of news, and the main HTML is then used in OBS Studio to display some news in a carrousel, one by one.
Cheers.
PS : go to twich.tv/sandwich_ttv if you want to watch the carrousel in action in my VODs.
I used my real IP with the port :80, and I worked to rewrite my JS scripts.
After a simple test with the new URL showing that a simple HTML line was correctly displaying, I started to rework my code.
I found that my second script was not seing the first script DOM modification probably because it was doing it too fast. So I added a pause somewhere (after billions of rewrittings ^^) and it finally worked.
Here's an excerpt of my code if you want just an insight :
At the bottom of my <body>, I call my JS controller :
Code: [Select]
<script>
window.onload = function(){
jsController();
};
</script>
In my controller :
Code: [Select]
async function jsController() {
console.log("jsController() => Lancement.");
await includeAllPartials(root); // We import the HTML snippets.
// await includeHTML(); // To use with w3_includeHTML.js, alternatively of the includeAllPartials() method if it fails.
await pause(1000); // Absolutely necessary for the DOM to be rewritten after the importation, or launchCarrousel() won't find the nodes.
await launchCarrousel();
}
I made me going crazy for 6 hours, but I finally found the light.
Quote
Can you upload those files you use?
Can't do this for now, I need to complete my work for the next weeks. In a near future, I should share it on Github.
It's a simple HTML that allow to import other HTML in wich I create <article> of news, and the main HTML is then used in OBS Studio to display some news in a carrousel, one by one.
Quote
In the meantime, the solution to avoid the cache, is adding a random number to the URL of your .js (JavaScript) filesThat's a crazy good workaround. I'll try to remember it the next time I'll face such a "cache" suspicion. ^^
Cheers.
PS : go to twich.tv/sandwich_ttv if you want to watch the carrousel in action in my VODs.