Locked JavaScript Include Breaks Functionality

I’ve Initialized the template called “Material Portfolio” and i need to use some JavaScript code that I’ve imported, unfortunately the forced include “assets/js/jquery.min.js” completely breaks the internal functionality of this javascript; I therefore request an option under Properties of a given html-file to disable the forced include on that html-file specifically.

Without the option to remove this forced include my code can simply not work unless I do a complete re-write of the entire code-base, which I prefer to not do.

I have confirmed that this is the case by exporting the project, and then removing the one single forced import line that is and suddenly everything works as expected.

Without the option to remove this forced include, my code can simply not work. Bare in mind that I need this change to only be applied onto a single HTML-file, not the entire project.

I take it you are creating it as a bootstrap 4 file, which requires jquery to run, try creating as a bootstrap 5 template, no jquery is required

1 Like

You can try turning the Jquery on in the settings as well if you haven’t tried that yet in the bootstrap 5 setup.

1 Like

Thank you so much for the very usefull answers; I have now converted my Bootstrap Project from version 4, to version 5, and now I am allowed to not include the jquery and my javascript is no longer broken. This can be done inside settings of the project, but it is only allowed if the project-version is 5 or above.

I do however still believe, that when you lock files to be forced into the exported project, then it should be possible to remove them from certain html-files, as it could otherwise break things.

+1 I should have added that in my last post as you really are correct I think in that there should be a way to not include some of the default files, these most especially. But …

With version 5 it does really take care of a lot of those issues so maybe not worth the work involved :slight_smile:

1 Like

jquery is a requirement for bootstrap 4, layout wise it would work without it, but taking it out could affect things like modals, dropdowns etc.

In bss, if you want to have a javascript file (or css file) only working on certain pages, right click on the filename in the Design panel and click visibility, this controls what html pages it will be included on.

The file I am referring to does not show up in the Design tab, it only shows up in the export files and within the “Include Order…” option when you right-click on JavaScript under design. Note that under the “Include Order…” option there is a lock on the side of it, and it cannot be removed. (Upgrading project to bss version 5 fixed it with global settings)

Your response could however be useful in other cases where you have included the .js-file yourself, but it is not a solution to this problem.