我有一个打开的链接,点击该链接打开pdf文件。 相同的代码如下所示,工作正常。
function OpenPdfPopup(ImageUrl) {
var winWidth;
var winHeight;
winWidth = screen.width;
winHeight = screen.height;
var urlpath = ImageUrl + ""
OpenWindow(urlpath, 'invImageWin', winWidth, winHeight, 'no')
}
var viewIMGDocQueue = function (link) {
var imgName = link.attr("data-imagename"),
ImageDirectory = link.attr("data-ImageDirectory"),
companyId = link.attr("data-companyid"),
winWidth,
winHeight,
imageId = link.attr('data-imageid'); // IAMGE ID IS NEEDED TO BE PASSED IN NEW WEBSITE AND THE PAGE LINK IS CHANED TOO.
imageId = imageId != undefined ? imageId : 0;
winWidth = screen.width;
winHeight = screen.height;
var urlpath = "../workflow/PdfDisplay.aspx?ImageId=" + imageId + "&file=" + imgName;
OpenWindow(urlpath, 'invImageWin', winWidth, winHeight, 'no');
};
但是当pdf文件名中包含%符号时会出现问题。 请为它建议解决方案。 注意:文件名不能转义%字符,因此无法在javascript中替换。