Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions form-validator/jquery.form-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1014,23 +1014,27 @@
$.formUtils.loadedModules[scriptUrl] = 1;
hasLoadedAnyModule = true;

// Load the script
script.type = 'text/javascript';
script.onload = moduleLoadedCallback;
script.src = scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' );
script.onerror = function() {
$.formUtils.warn('Unable to load form validation module '+scriptUrl);
};
script.onreadystatechange = function () {
// IE 7 fix
if (this.readyState === 'complete' || this.readyState === 'loaded') {
moduleLoadedCallback();
// Handle memory leak in IE
this.onload = null;
this.onreadystatechange = null;
}
};
appendToElement.appendChild(script);
if (typeof define === 'function' && define.amd) {
require([scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' )], moduleLoadedCallback);
} else {
// Load the script
script.type = 'text/javascript';
script.onload = moduleLoadedCallback;
script.src = scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' );
script.onerror = function() {
$.formUtils.warn('Unable to load form validation module '+scriptUrl);
};
script.onreadystatechange = function () {
// IE 7 fix
if (this.readyState === 'complete' || this.readyState === 'loaded') {
moduleLoadedCallback();
// Handle memory leak in IE
this.onload = null;
this.onreadystatechange = null;
}
};
appendToElement.appendChild(script);
}
}
}
});
Expand Down
38 changes: 21 additions & 17 deletions src/main/module-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,27 @@
$.formUtils.loadedModules[scriptUrl] = 1;
hasLoadedAnyModule = true;

// Load the script
script.type = 'text/javascript';
script.onload = moduleLoadedCallback;
script.src = scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' );
script.onerror = function() {
$.formUtils.warn('Unable to load form validation module '+scriptUrl);
};
script.onreadystatechange = function () {
// IE 7 fix
if (this.readyState === 'complete' || this.readyState === 'loaded') {
moduleLoadedCallback();
// Handle memory leak in IE
this.onload = null;
this.onreadystatechange = null;
}
};
appendToElement.appendChild(script);
if (typeof define === 'function' && define.amd) {
require([scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' )], moduleLoadedCallback);
} else {
// Load the script
script.type = 'text/javascript';
script.onload = moduleLoadedCallback;
script.src = scriptUrl + ( scriptUrl.slice(-7) === '.dev.js' ? cacheSuffix : '' );
script.onerror = function() {
$.formUtils.warn('Unable to load form validation module '+scriptUrl);
};
script.onreadystatechange = function () {
// IE 7 fix
if (this.readyState === 'complete' || this.readyState === 'loaded') {
moduleLoadedCallback();
// Handle memory leak in IE
this.onload = null;
this.onreadystatechange = null;
}
};
appendToElement.appendChild(script);
}
}
}
});
Expand Down