diff --git a/assets/js/script.js b/assets/js/script.js index b53232d..314aa4b 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -130,8 +130,9 @@ // Download page to pdf format window.onload = function() { - document.getElementById("generatePDF") - .addEventListener("click", () => { + var generatePDF = document.getElementById('generatePDF'); + if (typeof(generatePDF) != 'undefined' && generatePDF != null) { + generatePDF.addEventListener("click", () => { const content = this.document.getElementById("content"); console.log(content); console.log(window); @@ -146,4 +147,4 @@ }) } -})(jQuery); \ No newline at end of file +})(jQuery);