Checking to see if SVG is supported

Hello!

I’m using jQuery SVG and would like to check if the browser that the person is using will support SVG — if not, they’ll receive a polite message; is there anyway to check this using javascript?

Thank you,

Eric

Which SVG wrapper are you using for jQuery, perhaps it has built in detection?

You could also use the hasFeature function to detect support, but I’m not really sure about cross browser compatibility:


if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0")) {
    alert('Oops, your browser doesn't support svg');
}

Thanks for the quick reply!

-Eric