我怎样才能让使用base64编码方法IE浏览器的链接? [英] How can I make a link in IE using base64 encoding method?

查看:813
本文介绍了我怎样才能让使用base64编码方法IE浏览器的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我生成的飞行一个base64 GIF,我试图做一个链接到一个新页面打开GIF的全尺寸版本。这在铬,但在IE中,只有IMG缩略图显示。当有人点击IE浏览器中的链接,打开一个空白页。

有什么想法?

感谢

 回声'< A HREF =数据:图像/ GIF; BASE64,'$的数据。TARGET = _blank>';
呼应'< IMG SRC =数据:图像/ GIF; BASE64,'$的数据。'WIDTH =200/>< / A>';


解决方案

根据这个你不能在IE中使用数据URI进行导航。


  

      
  • 的Internet Explorer至7版(Web流量的约5%为2011年9月),缺乏支持。然而,这可以通过浏览器提供服务的具体内容加以克服。 [ 6 ]

  •   
  • Internet Explorer 8的极限数据URI为32 KB的最大长度。 (Internet Explorer 9中没有此限制) [ 4 ] [的 3 ]

  •   
  • 在IE 8和9的数据的URI可以仅用于图像,但不用于导航或Javascript生成的​​文件的下载。 [ 7 ]

  •   

I am generating a base64 gif on the fly and am trying to make a link to a new page to open a full size version of the gif. This works in chrome, but in IE, only the img thumbnail shows. When someone clicks on the link in IE, a blank page opens.

Any thoughts?

Thanks

Matt

echo '<a href="data:image/gif;base64,'. $data. '" target=_blank>';
echo '<img src="data:image/gif;base64,'. $data . '" width="200"/></a>';

解决方案

According to this you cannot use data uri for navigation in IE.

  • Internet Explorer through version 7 (approximately 5% of web traffic as of September 2011), lacks support. However this can be overcome by serving browser specific content.[6]
  • Internet Explorer 8 limits data URIs to a maximum length of 32 KB. (Internet Explorer 9 does not have this limitation)[4][3]
  • In IE 8 and 9 data URIs can only be used for images, but not for navigation or Javascript generated file downloads. [7]

这篇关于我怎样才能让使用base64编码方法IE浏览器的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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