Hello everyone!
I have a little problem with embedding some custom code. The problem is that Webflow automatically includes a script at the end of the body. This somehow clashes with a library that I’m trying to import. I verified this empirically by downloading my website and deleting that automatic line of code.
This is the incriminated line at the end of the body: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js" type="text/javascript"></script>
Is there a way to overcome this issue? Any help would be immensely useful, as I have no idea how to fix it.
The script that automatically gets added as you mentioned here is Webflow including jquery which it uses for interactions etc, my guess why it crashes is that you are also trying to include jquery along with the fullPage.js script…
Try removing jquery if you’ve included it, and it should work fine.
PS: If you can share your preview link, we can have a better look at what’s going on exactly and help you faster.
I tried to remove the first two lines in a local version of the page but this doesn’t work. It only works when I delete the jquery line at the end of the body.
I guess it’s because the browser needs to load jquery before the body, not at the end of it.
Try removing the custom jquery import and move all your scripts to the custom code field before the </body>, this is a better practice since this way your elements on the page will be loaded first before it needs to fetch any external resources which can slow down the loading times.
@SidneyOttelohe, thanks for the tip!
Unfortunately though, this doesn’t solve the problem.
The only way I managed to make this work is by removing the webflow imported jquery at the end of the body. I did this after exporting the code, and don’t think there is a way to do this directly in webflow.
@Dario I’m seeing you’re also using jqueryUI, my guess is that the problem lays there somewhere…
Looking at the console, the fullpage init function throws an error of not being a function when being invoked, which prolly is bcs the fullPage.js library doesn’t get loaded properly or doesn’t exist yet at the time the function is being invoked.
That’s interesting, I thought the browser would need to load the libraries before the body, like in a program. I’m new to programming.
I will see if I can fix the page but I’ve tried everything. At this point it might be better to just do everything by hand maybe.
I need to load JQuery before my additional scripts… Also restricting me to use 2.2.0 seems silly
There should be an option in the designer to simply let us choose whether we want it in the footer or whether we want to add our own version, through a cdn url or whatever