Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
raydoo
Topic Author
Posts: 9
Joined: 20 Oct 2019, 15:38

Insert Script into Body on one or all Websites

18 Aug 2021, 12:23

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" ?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Insert Script into Body on one or all Websites

19 Aug 2021, 00:28

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