I added google cse on my page. I used the easy way, so just pasted :
<script async src="https://cse.google.com/cse.js?cx=123456789"></script><div class="gcse-search"></div>
It worked perfectly. Until I added some other JavaScript at the end of the page. The page runs the script perfectly fine and the page contents, but the google search box disappears. When I comment out my added JavaScript the google search box appears again.