开发者

Setting img src to a data url via work does not work in IE8?

When I attempt to set an image to use a data url via JavaScript (from this question), it does not appear to work in IE8.

The page in that first link has: <img id="foo" src="alphaball.png">

On line 25, this JavaScript code executes: document.getEle开发者_运维问答mentById('foo').src = img_src;

On all other browsers (including IE9b) this successfully changes the image from the alphaball to a picture of my head. On IE8, I see the alphaball very briefly, and then it is replaced with a missing image icon.

Is this a known issue? Is there a workaround for using data urls with IE8 and JavaScript?


Internet Explorer versions before 9 do not support data URLs. There's an alternative mechanism that apparently kind-of works.

edit — actually I'm wrong; IE8 will support them as long as they're less than 32KB.

edit again — ok I found the article I was thinking about concerning the "MHTML" thing from Microsoft.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜