charge icon indicating copy to clipboard operation
charge copied to clipboard

How to run JavaScript in browser?

Open MarkLyck opened this issue 3 years ago • 0 comments

I'm setting up a dead simple page using Charge (love it btw.)

It's just a page telling the user they are blocked. But I need to display the URL that they are trying to access.

Normally I'd just use window.location for this. But when it's rendered server side there is no window.

And since no React is ever run in the browser, it never runs my line of JavaScript.

I tried creating another js file and importing it hoping it would get served with the HTML. But no :(

How do I serve a simple piece of JavaScript in the browser with Charge?

I'm even okay if it means adding a script tag to the React code, but that doesn't seem to work either :(

MarkLyck avatar May 19 '21 21:05 MarkLyck