summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-27 20:31:04 +0100
committerwout <wout@impinc.co.uk>2013-01-27 20:31:04 +0100
commitb9981fd5c28d7282e6160ec7a32bcc3b103b9cf8 (patch)
treedc7f0027f796644294b5589d8563478f44d6f2b8 /src/element.js
parentfe1747c86d0e562853752ac2b412ed33cd109c4f (diff)
downloadsvg.js-b9981fd5c28d7282e6160ec7a32bcc3b103b9cf8.tar.gz
svg.js-b9981fd5c28d7282e6160ec7a32bcc3b103b9cf8.zip
Fic in data() method
Diffstat (limited to 'src/element.js')
-rw-r--r--src/element.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js
index 3130d73..ab2a1e9 100644
--- a/src/element.js
+++ b/src/element.js
@@ -205,7 +205,7 @@ SVG.extend(SVG.Element, {
data: function(a, v) {
if (arguments.length < 2) {
var value = this.attr('data-' + a);
- return value ? JSON.parse(value) : value;
+ try { return JSON.parse(value); } catch(e) { return value; };
} else {
v === null ?