Putting java script on a page
Putting java script on a page
Hi there , trying to use a java script to load a cookie banner , tried in the htlm function and site html option without results , can anyone help me with this ?
Re: Putting java script on a page
You will need to provide a bit more information than that. Some scripts require code to be placed in different parts of the page. Without knowing how the script you are trying to use works it is hard to comment. Is this something in WB already or a 3rd party script you are trying to use? Do you have a link to the script you are using? Keep in mind, when asking for help you need to provide as much information as possible so we don't have to ask multiple questions.
- BaconFries
-
- Posts: 5640
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Putting java script on a page
@crispy68 Think it is related to the following thread as asking for assistance there.
viewtopic.php?p=487654#p487654
viewtopic.php?p=487654#p487654
Re: Putting java script on a page
Hi crispy68 , its the script to pop up the cookies consent from this page https://cookie-script.com/crispy68 wrote: ↑Wed Aug 16, 2023 10:23 pm You will need to provide a bit more information than that. Some scripts require code to be placed in different parts of the page. Without knowing how the script you are trying to use works it is hard to comment. Is this something in WB already or a 3rd party script you are trying to use? Do you have a link to the script you are using? Keep in mind, when asking for help you need to provide as much information as possible so we don't have to ask multiple questions.
the instructions tell me the this :
"This code will show a cookie banner and also control cookies. Choose your Geo-Targeting and copy the code below. Insert it in the header of your website as the first script before all other scripts. This code should be inserted on every page where the banner should be shown."
this is the actual code " <script type="text/javascript" charset="UTF-8" src="//cdn.cookie-script.com/s/73dc437b9d0ebc0ce95db58bda5f261b.js"></script> "
thank you for the attention
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Putting java script on a page
Within the `<head>` section, find the closing `</head>` tag. This is where you can add the code. You can add it to page from the pages html or your can take an html tool and place it there too.zemoura wrote: ↑Tue Aug 22, 2023 12:51 amHi crispy68 , its the script to pop up the cookies consent from this page https://cookie-script.com/crispy68 wrote: ↑Wed Aug 16, 2023 10:23 pm You will need to provide a bit more information than that. Some scripts require code to be placed in different parts of the page. Without knowing how the script you are trying to use works it is hard to comment. Is this something in WB already or a 3rd party script you are trying to use? Do you have a link to the script you are using? Keep in mind, when asking for help you need to provide as much information as possible so we don't have to ask multiple questions.
the instructions tell me the this :
"This code will show a cookie banner and also control cookies. Choose your Geo-Targeting and copy the code below. Insert it in the header of your website as the first script before all other scripts. This code should be inserted on every page where the banner should be shown."
this is the actual code " <script type="text/javascript" charset="UTF-8" src="//cdn.cookie-script.com/s/73dc437b9d0ebc0ce95db58bda5f261b.js"></script> "
thank you for the attention
Re: Putting java script on a page
Hi there , thanks for the input, the thing is they request it to be the 1st script in the head section and by putting betwen head tags it puts the script as the last one, i just don´t know how to put the code in the line that i desirewwonderfull wrote: ↑Tue Aug 22, 2023 3:28 amWithin the `<head>` section, find the closing `</head>` tag. This is where you can add the code. You can add it to page from the pages html or your can take an html tool and place it there too.zemoura wrote: ↑Tue Aug 22, 2023 12:51 amHi crispy68 , its the script to pop up the cookies consent from this page https://cookie-script.com/crispy68 wrote: ↑Wed Aug 16, 2023 10:23 pm You will need to provide a bit more information than that. Some scripts require code to be placed in different parts of the page. Without knowing how the script you are trying to use works it is hard to comment. Is this something in WB already or a 3rd party script you are trying to use? Do you have a link to the script you are using? Keep in mind, when asking for help you need to provide as much information as possible so we don't have to ask multiple questions.
the instructions tell me the this :
"This code will show a cookie banner and also control cookies. Choose your Geo-Targeting and copy the code below. Insert it in the header of your website as the first script before all other scripts. This code should be inserted on every page where the banner should be shown."
this is the actual code " <script type="text/javascript" charset="UTF-8" src="//cdn.cookie-script.com/s/73dc437b9d0ebc0ce95db58bda5f261b.js"></script> "
thank you for the attention
Re: Putting java script on a page
As far as I know you can't specify where inside the head tag. Unless Pablo adds an option of "insert after <head> tag" or "insert before </head> tag" then you will have to manually add the code after you've published the page.
-
-
- Posts: 1439
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Putting java script on a page
Yes @crispy68 is right. If you need to add it first before all other scripts or styles in header which loads then you must add it manually or can suggest @pablo for a built in feature.
Re: Putting java script on a page
You can add code in Page Proprieties -> Meta tags -> User Defined, to insert code right after the <head> tag