Limitations and Caveats

Before we continue, here are a few important things to note:

  • The techniques in this chapter are not compatible with scripts that are inlined (defined directly in your page’s markup). Inlining should be avoided when possible. If you must inline a script, don’t try to use the defer or async attribute on it.

  • When using any of the techniques in this chapter, you should not use document.write. Its behavior in asynchronously loaded scripts is unpredictable. If you don’t know what document.write is, then good. Suffice to say it’s the GOTO of DOM manipulation.

  • This is not a definitive guide. I’ve neglected some important platform-specific details for the sake of brevity. For example, certain mobile browsers will ...

Get Async JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.