JavaScript Loading Issue

2 replies · opened Jul 17, 2023

SSharadrsoniJul 17, 2023

Hi,

We are developing our website: www.revatics.co.uk using canvas 7 theme.
We are facing issues on loading javascript on runtime.
Problem is when the page is loaded from nested URL like: domain/path/page.html the JS function which loads the plugins and modules try to load from the relative path. i.e. domain/path/js/filename.js
Actually it should be from the root path: domain/js/filename.js

Here, for us the URL is: www.revatics.co.uk/services/web-development
So, the loading of plugins gives 404 because it loads from relative path - www.revatics.co.uk/services/js/plugins-name.js like this

To unblock our-self we have modified the code in functions.js under loadJS function [screenshot attached]

I am not sure if there is any solution existed for this problem, but I think a general solution should be there, hence request to assist here.

Regards,
Sharad

SSemicolon WebSTAFFJul 17, 2023

Hello,

We already have a Documentation to address loading JS using different Folders. Consider find the Using Custom JS/CSS Folders section under the Javascript Documentation: https://docs.semicolonweb.com/docs/getting-started/javascript/ . Do not edit any other part of the File as updating the JS/CSS Folders will automatically solve the issue.

So, simply setting jsFolder: 'https://www.revatics.co.uk/js/', will work fine.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSharadrsoniJul 17, 2023

Thanks for the details, this helped

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard