diff --git a/jscolor.js b/jscolor.js index 3270fb2..6556cba 100644 --- a/jscolor.js +++ b/jscolor.js @@ -52,7 +52,11 @@ var jsc = { register : function () { if (typeof window !== 'undefined' && window.document) { - window.document.addEventListener('DOMContentLoaded', jsc.pub.init, false); + if (window.document.readyState !== 'loading') { + jsc.pub.init(); + } else { + window.document.addEventListener('DOMContentLoaded', jsc.pub.init, false); + } } },