Providing Alternative to .SVG for IE8

seems that hype swaps to img-tag when detecting ie.

set an id to your svg-elements (hype-container)
place the png to swap in the resources

seems the img-tag-id will be: ‘img_’ + yourId

so onsceneload try:

//stackoverflow ...  
  function getIEVersion() {
        var match = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
        return match ? parseInt(match[1]) : undefined;
    }    
    
if(getIEVersion() < 9){
var imgId = 'img_' + 'yourId';

hypeDocument.getElementById(imgId).src = '${resourcesFolderName}/toSwap.png'
}
4 Likes