krux / postscribe

Asynchronously write javascript, even with document.write.
MIT License
986 stars 156 forks source link

Functions in postscribe scripts #515

Open kashid16 opened 1 year ago

kashid16 commented 1 year ago

I am unable to call functions metioned inside postscribe script. So let's say I have added func - function myFunction() { console.log("Calling func") let carName = "Volvo"; document.getElementById("demo1").innerHTML = typeof carName + " " + carName; }

And inside div I am calling this function with onclick. But I am getting error as "myFunction is undefined." Is this a limitation to postscribe ? Or am I doing something wrong ?