On-Demand Javascript
January 22, 2008 - 4:04pm — wlepinski
On-Demand Javascript Plugin aka "Lazy Loading"
Download Javascript as and when required, instead of downloading it all on page load. This is a "lazy loading" approach applied to Javascript, and has several benefits...
- Initial page load is faster.
- Overall bandwidth usage is less, since only Javascript that's required is used.
- Deployment is easier as the code takes care of pulling in Javascript, with the coder only ensuring enough is there to kick the process off.
- You can produce snippets of Javascript on the fly - effectively sending back a kind of "behaviour message" advising the browser on its next action. This is a variant of the core pattern described at the end of this section.
- You can bypass the standard "same-domain" policy that normally necessitates a Cross-Domain Proxy. Provided a server exposes a segment of valid Javascript, it can be extracted by the browser.
AjaxPatterns - On-Demand Javascript
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 1.0.0 | 2008-Jan-22 | 2.38 KB | Recommended for 1.2.x | ||
