In my Cordova app, I use InAppBrowser to present PDF documents
window.open = cordova.InAppBrowser.open;
document.onclick = function (e) {
e = e || window.event;
var element = (e.target || e.srcElement).closest("a");
if (element && element.getAttribute('target') === '_blank') {
window.open(element.href, "_blank", "location=yes,enableViewportScale=true");
return false; // prevent default action and stop event propagation
}
};
It works fine for one PDF, but another shows "Load Error". What's going on?