AlaskaAirlines / AuroDocsSite

Repository for the management of the Auro doc site
https://auro.alaskaair.com/
0 stars 0 forks source link

Consider moving or loading search script dynamically #251

Open rmenner opened 1 month ago

rmenner commented 1 month ago

suggestion (performance): Consider moving or loading search script dynamically

The inline script for Google Custom Search might impact initial page load performance. Consider moving it to the bottom of the body or loading it dynamically after the initial page load.

<div role="search">
  <div class="gcse-search"></div>
</div>
<script>
  window.addEventListener('load', function() {
    var script = document.createElement('script');
    script.src = 'https://cse.google.com/cse.js?cx=b792c366f1ce73e3d';
    document.body.appendChild(script);
  });
</script>

_Originally posted by @sourcery-ai[bot] in https://github.com/AlaskaAirlines/AuroDocsSite/pull/249#discussion_r1803878146_