title: Trying to save javascript array of SVG objects to SQL
body: <p>I'm creating a whiteboard application using SVG in HTML5, and javascript to manipulate the svg element using Javascript array of SVG elements to keep track of my shapes on the whiteboard.</p>
  
  <p>Now I'm trying to save everything on the whiteboard, thus every SVG object in the javascript shapes array to SQL using ASP.NET MVC 3 as my server side.</p>
  
  <p>I want to solve this by serializing the whole javascript array and save it as a string to SQL, then deserialize it when loading a drawing and add it to the current shapes array.</p>
  
  <p>Now I'we been trying to use JSON.stringify to achive this, but with no luck, and results in this error</p>
  
  <pre><code>Uncaught TypeError: Converting circular structure to JSON
  </code></pre>
  
  <p>Here is the script code</p>
  
  <pre><code>$("#save").click(function () {
      var request = $.ajax({
          url: "/Drawing/SaveDrawing",
          type: "POST",
          data: { s: JSON.stringify(shapes) },
          dataType: "json"
      });
  });
  </code></pre>
  
  <p>All ideas are welcome, just hope my question is somewhat clear</p>