#So is there no way to run Javascript client side? Even something small like a FB pixel?
1 messages · Page 1 of 1 (latest)
Deno is a Runtime that runs on server, it's not meant to run on client side.
It has a framework named Fresh that uses Deno in backend and serves HTML content pre-rendered on server. You can add your script on a landing page if created with Fresh
Just bundle and send the JS to the client
Just serve the needed JS file with Deno (like a static CSS file or other). How you do this depends on the framework. Then import the file on your client html (<script src=... >) or JS files (import ... from ...) . https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
script src is used when doing in HTML(For you),
but in many frameworks you get option to do it using import, one of them is Svelte I guess.
🙏 thank you for clearing that up for me!
Regarding Deno Fresh: But then you're not able to pass e.g. the props to the script (?).