Created
November 26, 2014 16:54
-
-
Save mvaz/46303541c90a29dff899 to your computer and use it in GitHub Desktop.
Only load JS once
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var libs = {}; | |
function getLib(lib){ | |
if (!libs[lib]){ | |
$.getScript(lib, function() { | |
libs[lib] = 1; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/5845230/getscript-how-to-only-call-if-not-already-called