< object>标签与pdf不工作在Firefox和被搞乱在IE [英] <object> tag with pdf doesn't work in firefox and is messed up in IE

查看:148
本文介绍了< object>标签与pdf不工作在Firefox和被搞乱在IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的对象标签:

 < div id =embeddedPdfContainer>< object data =< c:url value =/ download-pdf / $ {id}/> id =embeddedPdfwidth =820height =1135type =application / pdf>< / object>< / div> 

在chrome这个标签的工作方式,我想要它。在firefox它根本不工作,它在IE中搞乱了。这里是相册,每个浏览器都有屏幕截图。我在这里的选项是什么?



同样在firefox我发现这个pdf不适用于默认firefoxe的pdf查看器。

解决方案

你可以直接写pdf的链接如下:

 < div id =embeddedPdfContainer>< object data =/ download- pdf / some.pdfid =embeddedPdfwidth =820height =1135type =application / pdf>< / object>< / div> 

我使用Chrome和Internet Explorer(不同版本)测试了它,它的工作



如果你想留在c:url选项,你应该改变第二个to



>

 < c:url value =/ download-pdf / $ {id}/>



  < c:url value ='/ download-pdf / $ {id}'/>

,以便不转义字符串


I have object tag that look like this :

<div id="embeddedPdfContainer"><object data="<c:url value="/download-pdf/${id }"/>" id="embeddedPdf"  width="820" height="1135" type="application/pdf"></object></div>

In chrome this tag works the way I want it to. In firefox it doesn't work at all and it's messed up in IE. Here's album with screenshots in each browser. What are my options here ?

Also on firefox I figured out that this pdf doesn't work with default firefoxe's pdf viewer. When I choose to use adobe acrobat extenstion for pdf documents it works perfectly.

解决方案

You can just write the link to the pdf directly into the data attribute like this:

<div id="embeddedPdfContainer"><object data="/download-pdf/some.pdf" id="embeddedPdf"  width="820"  height="1135" type="application/pdf"></object></div>

I tested it with Chrome and Internet Explorer (different versions) and it works

If you want to stay with the c:url option you should change the second " to '

so changing this:

"<c:url value="/download-pdf/${id }"/>"

into this:

 "<c:url value='/download-pdf/${id }'/>"

in order to not "escape" the string

这篇关于&lt; object&gt;标签与pdf不工作在Firefox和被搞乱在IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆