Can I add my own JavaScript to my website?
Yes, on a website: Developer → Code → scripts/site.js is your site's own JavaScript. It runs on your published site, after Furge's own code, and in Developer mode's Preview; never on the canvas. furge.onPage(page => …) runs for the page that's showing and for every page after it, with the page's name. Errors and console.log show in the Preview's Console. Publishing checks it like an uploaded site's files: a crypto miner, or code that sends visitors straight to another site, is refused. Sections themselves never run scripts (use Furge's own interactions there, such as data-tabs and data-reveal), and an app's behaviour is its logic, in the Backend.
Steps
- Turn on Developer (Shift+D) and open Code.
- Open scripts/site.js, write your code and press Save.
- Open Preview and its Console to see it run, then publish.
Also asked as
- my own javascript
- add javascript
- custom javascript
- custom js
- add a script
- script tag
- run my own code on the site
- site.js
- add tracking code
- javascript on my website
- onpage
Related
Still stuck? Ask Furge Help, the round chat button at the bottom right, or contact the Furge team.