#Unwanted loading of javascript from other page to homepage

1 messages · Page 1 of 1 (latest)

pure nest
#

Hi guys, I just finished website https://epicvans.sk and I found out that on homepage is loading javascript from "contact" page https://epicvans.sk/kontakt even it is placed just on the "contact" page so i thought it would be loading just there. For contact form i use web3forms.com. Why is it like that, did i mixed something in project structure or it is common behaviour of Astro when building static pages?

bronze raven
#

No it's not common. Do you use ClientRouter? Where exactly is the script placed? Can you share some code ?

pure nest
#

Hi @bronze raven it's this block here. It's on hompage, even it is only on contact page and should be just there.

bronze raven
#

So you do use client router. Can you show the code of the contact page eg kontakt.astro, specifically where is the script placed there

pure nest
bronze raven
#

Ah so it's script inline so it's either a) bug or b) you have the form imported somewhere and you don't know it 😅 or c) you simply have the script defined somewhere else also

Can you try to remove the ClientRouter from <head> and check if the script is still on the homepage? Just to be sure

#

Wait a second, i see another form on the homepage from web3forms, dont you use the same script also for that form (see the screenshot).

pure nest
#

damn @bronze raven i'm so retarded, yes it's couple of days i added it under video header, but with different input fields 😶‍🌫️

bronze raven
#

Damn, sometimes you just need another pair of eyes houston_salute