4 ms·
The article has to do with loading javascript asynchronously and not CSS (title is misleading..). Great article but it fails to mention something important. A
by ashray 14y ago
The article has to do with loading javascript asynchronously and not CSS (title is misleading..).
Great article but it fails to mention something important. A lot of 3rd party scripts use document.write. What this means is that even if you try to load them up asynchronously you will fail because the browser will wipe out the DOM when it gets to those calls.
What you need in that case is a document.write override. I use writecapture (http://github.com/iamnoah/writeCapture http://github.com/iamnoah/writeCapture) for all my async needs since it'll load up scripts asynchronously but will override any document.write calls in them to make the script truly async. This prevents the DOM from getting wiped out on an async load.
- twinturbo 14y ago> Great article but it fails to mention something important. A lot of 3rd party scripts use document.write. What this means is that even if you try to load them up asynchronously you will fail because the browser will wipe out the DOM when it gets to those calls. Yup
- da_n 14y agoJust so you know, and easy mistake, but CSS-Tricks is the name of the website, not a reference to the language being used.