pdf.combined.js给出了IE 11中未定义或空引用的错误

时间:2016-08-30 15:32:49

标签: angularjs internet-explorer pdf

我的角度模块中有pdf.js和pdf.combined.js依赖项,它在Chrome浏览器中工作正常但在IE 11中生成空引用错误。

pdf.combined.js

  if (!PDFJS.workerSrc && typeof document !== 'undefined') {
  // workerSrc is not set -- using last script url 
   to define default location
 PDFJS.workerSrc = (function () {
 'use strict';
  var pdfJsSrc = document.currentScript.src;
  return pdfJsSrc && pdfJsSrc.replace(/\.js$/i, '.worker.js');
 })();

 SCRIPT5007: Unable to get property 'src' of undefined or null reference

for line of code:
 var pdfJsSrc = document.currentScript.src;

0 个答案:

没有答案