I'm loading lightbox2 via the following CDN //cdnjs.cloudflare.com/ajax/libs/lightbox2/2.7.1/js/lightbox.min.js
if this is unavailable then I want to fallback to my core files. How do I check to see if lightbox has already been defined so as to avoid loading my core files.
I tried typeof lightbox === "undefined"
but that always returns true forcing my core files to be loaded.
I have fallbacks for jquery, angular etc already - it is lightbox2 that I am having issues with checking if it has already been loaded.