Created
July 25, 2016 00:48
-
-
Save timwburch/93c8bb55f55a752fc1b6115238755bdd to your computer and use it in GitHub Desktop.
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
// Check that jQuery is | |
// loaded with an upper limit | |
// for the number of calls. | |
function checkjQuery(upper) { | |
if (typeof jQuery != 'undefined') { | |
jQuery(document).ready(function () { | |
// jQuery dependant function | |
}); | |
} else { | |
if (upper <= 100) { | |
var checkjQueryTimeout = setTimeout(checkjQuery(upper + 1), 200); | |
} | |
} | |
} | |
setTimeout(function() { checkjQuery(1) }, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment