The Google javascript API client library script is loaded in the section like this:
<script src="https://apis.google.com/js/client.js?onload=loadBodies" type="text/javascript"></script>
The method specified in the onload parameter is called when the API code has loaded. Is it guaranteed that this will also be after the DOM has finished loading? My onload method needs to find an element by ID and modify it using data obtained from the Google API, and I'm worried about whether I can count on the element being available at the time the method is called. jsjs
The JS Client loads asynchronously independent of the DOM load, so there is no guarantee the DOM will be ready when the JS Client has finished loading. You can wait for DOM load to start loading the JS Client, but for best performance I recommend using a window.onload callback and a JS Client onload callback, and look for your element in whichever fires second.