We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d71c5f commit 177fbe3Copy full SHA for 177fbe3
src/assets/netteForms.js
@@ -38,7 +38,9 @@
38
* Attaches a handler to an event for the element.
39
*/
40
Nette.addEvent = function(element, on, callback) {
41
- if (element.addEventListener) {
+ if (on === 'DOMContentLoaded' && element.readyState !== 'loading') {
42
+ callback.call(this);
43
+ } else if (element.addEventListener) {
44
element.addEventListener(on, callback);
45
} else if (on === 'DOMContentLoaded') {
46
element.attachEvent('onreadystatechange', function() {
0 commit comments