Streaming live at 10am (PST)

Custom js codes don't seem to work

Hi everybody,

I have a custom calculator which I’m trying to integrate into a Webflow page. At first, I linked JS files hosted externally, it didn’t seem to work. But I found a solution in the forum to host them inside Webflow as txt files.

But, this didn’t seemed to solve my problem. I feel that there are some kind of conflicts with the JS files, but I can’t find a solution to that.

The project works just fine, here’s a link hosted into github:

It’s the exact same code I’m using into Webflow:

Thank you all in advance for your help.

Hi Anis,
Did you add a <script src="your-file-link-js.txt"></scrip> tag before the </body>?

Can you also add a read-only link?

Yes, I added both CSS (to head tag) and JS (Before tag).

Here’s a read-only link

No one ecountered same issues?!

As with HTML and CSS, you can ensure better quality, less error-prone JavaScript code using a linter, which points out errors and can also flag up warnings about bad practices, etc., and be customized to be stricter or more relaxed in their error/warning reporting. The JavaScript/ECMAScript linters we’d recommend are JSHint and ESLint; these can be used in a variety of ways, some of which we’ll detail below.

Thank you for your reply. I checked the JS and the files are fine. As I precised in my precedent message. The project work fine when I host it as html files (example in Github) at the moment I put it into Webflow, it doesn’t work.