I have a link to open, on click of which a pdf file opens. The code for the same is as displayed below and works fine.
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');
};
But the problem occurs when the pdf file name has % sign in it. Please suggest solution for it. Note: The file name cannot escape the % character and hence it cannot be replaced in javascript.