Page 1 of 1

Insert Script into Body on one or all Websites

Posted: 18 Aug 2021, 12:23
by raydoo
I am just trying out the Google Site search

Now i got this line of code which i should insert into the Body Part of the HTML Code

<script async src="https://cse.google.com/cse.js?cx=xxxxxx ... "></script>

<div class="gcse-search"></div>

i would like to put it into a menu item, should i put it into the Page Javascript part or is there another option ? 

Should i just enter async src="https://cse.google.com/cse.js?cx=xxxxxxxxxxxxx" ?

Re: Insert Script into Body on one or all Websites

Posted: 19 Aug 2021, 00:28
by mjau-mjau
Hi. Do you have an example of the Google site search so I can see what I'm dealing with? If you want to add these things for example into the menu, did you plan how it should work on mobile devices? These things need to be planned and integrated properly, but first we need to see if it works. Since X3 is an "ajax" app (loads partial data and injects into page when clicking in the menu), we may need to take that into consideration also.
raydoo wrote:Now i got this line of code which i should insert into the Body Part of the HTML Code
<script async src="https://cse.google.com/cse.js?cx=xxxxxx ... "></script>

<div class="gcse-search"></div>
For now, just insert into a page's "content" section to see if it works and how it works. I would assume the <script> should go below the <div>?