how to parse json string contains circular reference in javascript?
<p>I have the following json string in javascript. This string contains a circular references. I want to parse this string in such a way that the reference will be replaced by its actual object. I use <code>Json.Parse</code> but it creates the json object with references. Is there any way by whihc i can achieve this ?</p>

<pre><code>{
  "$id": "1",
  "$values": [
    {
      "$id": "2",
      "Event": {
        "$id": "3",
        "Invitaions": {
          "$id": "4",
          "$values": [
            {
              "$ref": "2"
            },
            {
              "$id": "5",
              "Event": {
                "$ref": "3"
              },
              "Id": 2,
              "Name": "test2",
              "Date": "24",
              "EventId": 1
            }
          ]
        },
        "Id": 1,
        "Name": "marriage",
        "Address": "abcd"
      },
      "Id": 1,
      "Name": "test1",
      "Date": "23",
      "EventId": 1
    },
    {
      "$ref": "5"
    },
    {
      "$id": "6",
      "Event": {
        "$id": "7",
        "Invitaions": {
          "$id": "8",
          "$values": [
            {
              "$ref": "6"
            }
          ]
        },
        "Id": 2,
        "Name": "birthday",
        "Address": "abcd"
      },
      "Id": 3,
      "Name": "test3",
      "Date": "25",
      "EventId": 2
    }
  ]
} 
</code></pre>
