I am creating a single file HTML5 application that has all image resources embedded as a Data Uri
. This application contains an image gallery (fancy box) that uses <a>
tags as the source of the image to show in its popup, as many other do. e.g.
<li>
<a href="photos/FL6C2632.jpg">
<img src="data:image/jpeg;base64,somebase64stringetc014564hkjhkj" />
</a>
</li>
Replacing the src
attribute of the img
tag with data uri works as expected, however replacing the a
tag's href
with a base64 equivalent rather than some genuine path to an image does not.
Is there anyway at all of being able to use data uri in a href attribute rather than an existing physical location?
So for example (which doesn't work)
<li>
<a href="data:image/jpeg;base64,someotherbase64stringetc014564hkjhkj">
<img src="data:image/jpeg;base64,somebase64stringetc014564hkjhkj" />
</a>
</li>