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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -