tarteaucitron.js: Now using document.currentScript if available
This commit is contained in:
parent
fbf3a8cf27
commit
024793ef12
|
|
@ -1,7 +1,7 @@
|
||||||
/*jslint browser: true, evil: true */
|
/*jslint browser: true, evil: true */
|
||||||
|
|
||||||
var scripts = document.getElementsByTagName('script'),
|
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,
|
tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
|
||||||
cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
|
cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
|
||||||
alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
|
alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue