diff options
author | wout <wout@impinc.co.uk> | 2013-01-27 20:31:04 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-01-27 20:31:04 +0100 |
commit | b9981fd5c28d7282e6160ec7a32bcc3b103b9cf8 (patch) | |
tree | dc7f0027f796644294b5589d8563478f44d6f2b8 /src/element.js | |
parent | fe1747c86d0e562853752ac2b412ed33cd109c4f (diff) | |
download | svg.js-b9981fd5c28d7282e6160ec7a32bcc3b103b9cf8.tar.gz svg.js-b9981fd5c28d7282e6160ec7a32bcc3b103b9cf8.zip |
Fic in data() method
Diffstat (limited to 'src/element.js')
-rw-r--r-- | src/element.js | 2 |
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 ? |