Grabbing innerHTMl of this div
<div style="display:none;" id="graphdata">{n:2 , e:1},{from:1 , to:2},{from:2, to:3},{from:3, to:4}</div>
then parsing it with this JS code
jdiv=document.getElementById('graphdata').innerHTML;
edges=JSON.parse(jdiv);
JS console in Chrome says:
Uncaught SyntaxError: Unexpected token n
can't find out where is that token n can be and what's wrong with my code? any ideas?