- to save bandwidth: the API output/result is not visible on page load and will only appear after user interaction (e.g. tabs, scrolling, …)
- to speed up main content: if there is content that should be rendered before
Only after the user does a specific interaction – e.g. click a button to open a map – the client code loads the JS API, and then uses it to show some information – in that case, a map.
This performance improvement is useful when the use of the JS API is not central to the page (not over-the-fold):
- Speeds up the page load
Speed up Main Content
After the page is loaded (e.g. DOMContentLoaded fired), the client code loads the JS API and uses it to show some extra information.
Speedup Page Rendering
<HEAD>, so that the configured CSS comes as soon as possible. But we give an additional
- The page renders and becomes interactive much sooner.
- When done loading, the
initOAfunction is called, where the client calls resides (e.g.