summaryrefslogtreecommitdiffstats
path: root/src/element.js
diff options
context:
space:
mode:
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 ?