These css based tag solutions seem somewhat exotic and seems you need to do tricks to ensure one or the other assets are not loaded by the browser.
The mark up could take advantage of noscript something like: <noscript><img src="image path"></img></noscript> <scirpt> mw.outputPngOrSvg( 'NameOfImage.svg' ) <script>
Your outputPngOrSvg could document.write the png or svg to the page so you never wait for dom ready or simply define and close a div target prior to your small inline script if you don't like the document.write idea.
--michael
On 03/21/2012 06:13 PM, Daniel Friesen wrote:
Yup. Browsers load images whether they are visible or not. (And there are practices web developers use to make things better that rely on this fact) So that would mean that every browser would unconditionally be loading both a .png and .svg image for every single file. Additionally text browsers and search engines would see two images in every image block and could have side effects.
;) It's also a horrible markup hack.