Edit custom code without publishing site again and again

Hello,

I happy to share with you my solution to work onto work on custom code without having to save and republish the site so that the changes are visible.

We save an incredible amount of time. (…)(…)(…)(…)(…)(…)

The basic principle is to host the script on your server and to call it via a script in webflow which will force the browser to refresh the file.

Here is the code to put in the before closing body

<script>  
var script = document.createElement('script');
 var myRandom= Math.floor(Math.random() * 100000000);  
//Change the address of the script bellow
 script.src = "https://my-personnal-server/my-script.js?version="+myRandom+'"';
 document.head.appendChild(script);
</script>

I wrote an article to explain how this works on my site.

Thank to DeepL Translate: The world's most accurate translator (free version) to help me post in english faster


Here is my site Read-Only: LINK
(how to share your site Read-Only link)