diff --git a/tarteaucitron.js b/tarteaucitron.js index bcc8cc5..36b0753 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1,7 +1,7 @@ /*jslint browser: true, evil: true */ var scripts = document.getElementsByTagName('script'), - path = scripts[scripts.length - 1].src.split('?')[0], + path = (document.currentScript || scripts[scripts.length - 1]).src.split('?')[0], tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN, cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN, alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,