3

I am trying to load an image using AJAX that is sent as data uri. Everything works fine as long as image is < 32kb. Some of the images are large in size around 500 kb. I did some research on this and found that IE8 supports only images < 32kb to be loaded using datauri.

Is there any workaround to load the image which is > 32kb or am i missing something here?

Asdfg
  • 11,362
  • 24
  • 98
  • 175

3 Answers3

3

Data URI scheme

Internet Explorer 8: Microsoft has limited its support to certain "non-navigable" content for security reasons, including concerns that JavaScript embedded in a data URI may not be interpretable by script filters such as those used by web-based email clients. Data URIs must be smaller than 32 KiB in Version 8.[3] Data URIs are supported only for the following elements and/or attributes:[4]

  • object (images only)
  • img
  • input type=image
  • link (data URI must be base64 encoded)
  • CSS declarations that accept a URL, such as background-image, background, list-style-type, list-style and similar.

Internet Explorer 9: Internet Explorer 9 does not have 32KiB limitation and allowed in broader elements.

epascarello
  • 204,599
  • 20
  • 195
  • 236
  • 3
    i know this part and i went thru the article on wikipedia. I am looking for a solution or workaround. – Asdfg Jun 13 '12 at 15:25
0

Yes, serve it as MHTML using some commentring tricks, described here and here.

Indolering
  • 3,058
  • 30
  • 45
-1

You could load the image data into a canvas element.
For IE8 you should have a look at How can I use the HTML5 canvas element in IE?

Community
  • 1
  • 1
Andreas
  • 21,535
  • 7
  • 47
  • 56
  • takes forever to load the image. IE stops responding and asks to stop running the script. :( – Asdfg Jun 13 '12 at 16:28
  • Canvas element is not supported and IE. So this is not a solution – dude Dec 17 '14 at 13:21
  • @julmot The `canvas` element is [supported in IE since version 9](http://caniuse.com/#search=canvas). And for IEv8 I've added a link for a workaround (and anything below IE8 should not be supported from anybody). So the downvote isn't justified... :| – Andreas Dec 17 '14 at 14:13
  • @julmot And for this I've added the link to [How can I use the HTML5 canvas element in IE?](http://stackoverflow.com/questions/1332501/how-can-i-use-the-html5-canvas-element-in-ie) - The heck with it...! – Andreas Dec 17 '14 at 14:39
  • Well a link to a compatibility view is not a solution. If you just want to share a link you should use the comment box. – dude Dec 17 '14 at 15:26