I have just downloaded Snap SVG and I'm trying to figure out how to display an image with a fall back arrangement. Here is the code:
var s = Snap("#MyPopup");
var g = s.g();
var image = g.image("http://myimages.com/xyz.png", 250, 10, 40,40 );
This displays the image perfectly. However, if the image is missing then you get that broken image-not-fond icon. Instead of that I want to display an alternate image, say http://myimages.com/abc.png , if the primary image is not found (similar to onerror used with <img>
). Can someone please guide me how to do that.