Merge pull request #532 from prudloff-insite/patch-1

Callback called too soon for external scripts
This commit is contained in:
Amauri CHAMPEAUX 2020-11-27 17:11:25 +01:00 committed by GitHub
commit 94cf8b232f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1598,7 +1598,7 @@ var tarteaucitron = {
} }
if (typeof callback === 'function') { if (typeof callback === 'function') {
if ( !tarteaucitron.parameters.useExternalJs ) { if ( !tarteaucitron.parameters.useExternalJs || !internal ) {
script.onreadystatechange = script.onload = function () { script.onreadystatechange = script.onload = function () {
var state = script.readyState; var state = script.readyState;
if (!done && (!state || /loaded|complete/.test(state))) { if (!done && (!state || /loaded|complete/.test(state))) {