Page 1 of 1

Putting java script on a page

Posted: Wed Aug 16, 2023 9:01 pm
by zemoura
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

Posted: Wed Aug 16, 2023 10:23 pm
by crispy68
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.

Re: Putting java script on a page

Posted: Wed Aug 16, 2023 10:48 pm
by BaconFries
@crispy68 Think it is related to the following thread as asking for assistance there.
viewtopic.php?p=487654#p487654

Re: Putting java script on a page

Posted: Tue Aug 22, 2023 12:51 am
by zemoura
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.
Hi crispy68 , its the script to pop up the cookies consent from this page https://cookie-script.com/

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

Posted: Tue Aug 22, 2023 3:28 am
by wwonderfull
zemoura wrote: Tue Aug 22, 2023 12:51 am
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.
Hi crispy68 , its the script to pop up the cookies consent from this page https://cookie-script.com/

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
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.

Re: Putting java script on a page

Posted: Wed Aug 23, 2023 12:23 am
by zemoura
wwonderfull wrote: Tue Aug 22, 2023 3:28 am
zemoura wrote: Tue Aug 22, 2023 12:51 am
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.
Hi crispy68 , its the script to pop up the cookies consent from this page https://cookie-script.com/

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
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.
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 desire

Re: Putting java script on a page

Posted: Wed Aug 23, 2023 2:28 am
by crispy68
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.

Re: Putting java script on a page

Posted: Wed Aug 23, 2023 2:44 am
by wwonderfull
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

Posted: Wed Aug 23, 2023 6:11 am
by Pablo
You can add code in Page Proprieties -> Meta tags -> User Defined, to insert code right after the <head> tag

Re: Putting java script on a page

Posted: Wed Aug 23, 2023 11:59 pm
by zemoura
Pablo wrote: Wed Aug 23, 2023 6:11 am You can add code in Page Proprieties -> Meta tags -> User Defined, to insert code right after the <head> tag
thank you very much pablo it worked