javascript - Cannot read property 'firstElementChild' of null, pdf.js -
i trying embedded pdf on html page using pdf.js
, of pdf viewer blog,i have included pdf.js
, pdf.worker.js
in html file, when open page, nothing embedded , getting below error
cannot read property firstelementchild of null
please me in this.
thanks!
html code:
<body> <div class="pdfjs"> </div> <script src="{% static 'pdf.js-viewer/pdf.js'%}"></script> <script src="{% static 'pdf.js-viewer/pdf.worker.js'%}"></script> <script type="text/javascript"> pdfjs.webviewerload('http://url/mypdf.pdf'); </script> </body>
checkout below error:
uncaught (in promise) typeerror: cannot read property 'firstelementchild' of null @ object.pdfviewer (http://url/pdf.js:17939:52) @ http://url/pdf.js:12985:21 @ object._initializeviewercomponents (http://url/pdf.js:12973:10) @ http://url/pdf.js:12884:16pdfviewer
Comments
Post a Comment