1
我有一个JSP文件中的iFrame来显示PDF文件,因为我将此页面包含在另一个JSP文件中并尝试显示相同的文件。它在Firefox中正常工作,但在Chrome和IE中无法正常工作。这里通过我附加了脚本和html内容。iFrame浏览器问题,同时在另一个JSP文件中包含一个JSP文件
脚本:
function displayAttachmentInIframe(attachmentPath)
{
var iframeElementId = '#employeeDetailsAttachmentDisplayIFrame';
var iframeElementStyleClass = 'margin-top: 0px; width: 600px; height: 400px;
border:0px; overflow-x: hidden;';
jQuery(iframeElementId).attr('src', attachmentPath);
jQuery(iframeElementId).attr('style', iframeElementStyleClass);
}
HTML代码:
<iframe id="employeeDetailsAttachmentDisplayIFrame"/>
<h:graphicImage id="employeeDetailsAttachmentImage"
url="#{EmployeeDetails.attachedFilePath}"
alt="Attachment Not Found"
style="width: 580px; height: 400px;" />