#So is there no way to run Javascript client side? Even something small like a FB pixel?

1 messages · Page 1 of 1 (latest)

tired mirage
#

I'm a bit of a deno newbie just playing around, was trying to set up a landing page with Facebook Pixel/Google Analytics scripts and can't really figure out a good way to approach the problem.

sterile shard
#

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

last jacinth
grizzled hollow
#

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

The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are called live bindings because they are updated by the module that exported the binding, but cannot be modified by the importing module.

sterile shard
tired mirage
#

🙏 thank you for clearing that up for me!

analog wraith