gpt4 book ai didi

internet-explorer - 如何使用 base64 编码方法在 IE 中创建链接?

转载 作者:行者123 更新时间:2023-12-04 07:48:01 24 4
gpt4 key购买 nike

我正在动态生成 base64 gif,并尝试创建指向新页面的链接以打开 gif 的全尺寸版本。这适用于 chrome,但在 IE 中,仅显示 img 缩略图。当有人在 IE 中单击链接时,会打开一个空白页面。

有什么想法吗?

谢谢

马特

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

最佳答案

根据 this您不能在 IE 中使用数据 uri 进行导航。

  • 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]

关于internet-explorer - 如何使用 base64 编码方法在 IE 中创建链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12791952/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com