From 5020240e4029a61a9620f21d7be4d9764e7723d1 Mon Sep 17 00:00:00 2001 From: wout Date: Fri, 15 Feb 2013 15:58:40 +0100 Subject: [PATCH] Added SVG.supported to README --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 7afe797..5c9a8a9 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,19 @@ By default the svg canvas follows the dimensions of its parent, in this case `#p var draw = svg('paper').size('100%', '100%'); ``` +### Checking for SVG support + +By default this library assumes the client's browser supports SVG. You can test support as follows: + +```javascript +if (SVG.supported) { + var draw = svg('paper'); + var rect = draw.rect(100, 100); +} else { + alert('SVG not supported'); +} +``` + ## Elements -- 2.39.5