我的角度模块中有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;