Putting java script on a page

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
zemoura
 
 
Posts: 24
Joined: Mon Feb 06, 2023 5:53 pm

Putting java script on a page

Post 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 ?
User avatar
crispy68
 
 
Posts: 2912
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Putting java script on a page

Post 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.
User avatar
BaconFries
 
 
Posts: 5640
Joined: Thu Aug 16, 2007 7:32 pm

Re: Putting java script on a page

Post by BaconFries »

@crispy68 Think it is related to the following thread as asking for assistance there.
viewtopic.php?p=487654#p487654
zemoura
 
 
Posts: 24
Joined: Mon Feb 06, 2023 5:53 pm

Re: Putting java script on a page

Post 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
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Putting java script on a page

Post 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.
zemoura
 
 
Posts: 24
Joined: Mon Feb 06, 2023 5:53 pm

Re: Putting java script on a page

Post 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
User avatar
crispy68
 
 
Posts: 2912
Joined: Thu Oct 23, 2014 12:43 am
Location: Acworth, GA
Contact:

Re: Putting java script on a page

Post 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.
wwonderfull
 
 
Posts: 1439
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Putting java script on a page

Post 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.
User avatar
Pablo
 
Posts: 22472
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Putting java script on a page

Post by Pablo »

You can add code in Page Proprieties -> Meta tags -> User Defined, to insert code right after the <head> tag
zemoura
 
 
Posts: 24
Joined: Mon Feb 06, 2023 5:53 pm

Re: Putting java script on a page

Post 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
Post Reply