Skip to content

Instantly share code, notes, and snippets.

View harshadsatra's full-sized avatar
👨‍💻
Coding...

Harshad Satra harshadsatra

👨‍💻
Coding...
View GitHub Profile
@harshadsatra
harshadsatra / lazy-load-files.js
Created July 19, 2016 04:42 — forked from seantunwin/lazy-load-files.js
Lazy load JavaScript files
/* This is a technique to lazy load your javascript files
* Handy for those pesky slow, load blocking off-site scripts
* function lazyLoad
* @s: String of path to file
*/
function lazyLoad(s) {
var d = window.document;
b = d.body; /* appends at end of body, but you could use other methods to put where you want */
e = d.createElement("script");