title: How to parse a JSON that has nested escaped JSON inside it in javascript?
body: <p>Update : This JSON is just one of the examples, I need to read these JSON files and pass them to a function that accepts JSONObject.</p>
  
  <p>I have one JSON like this - </p>
  
  <pre><code>    {   "log": {
      "version": "1.2",
      "entries": [
        {
          "response": {
            "status": 200,
            "statusText": "OK",
            "httpVersion": "HTTP/1.1",
            "headers": [
              {
                "name": "Date",
                "value": "Tue, 19 Feb 2019 13:50:34 GMT"
              },
              {
                "name": "CF-RAY",
                "value": "4ab934095ceacc4c-ZRH"
              },
              {
                "name": "Content-Encoding",
                "value": "gzip"
              }
            ],
            "cookies": [],
            "content": {
              "size": 155,
              "mimeType": "application/json",
              "compression": 0,
              "text": "{\"ip\":\"45.64.195.115\",\"ip_decimal\":759219059,\"country\":\"India\",\"country_eu\":false,\"country_iso\":\"IN\",\"city\":\"nocity\",\"latitude\":98.975,\"longitude\":92.8258}"
            },
            "redirectURL": "",
            "headersSize": 230,
            "bodySize": 155,
            "_transferSize": 385
          },
          "cache": {},
          "timings": {
            "blocked": 6.805000007039867,
            "dns": -1,
            "ssl": -1,
            "connect": -1,
            "send": 0.22000000000000064,
            "wait": 174.87700000413787,
            "receive": 11.549999995622784,
            "_blocked_queueing": 0.8590000070398673
          },
          "serverIPAddress": "100.28.12.103",
          "_initiator": {
            "type": "other"
          },
          "_priority": "VeryHigh",
          "connection": "509100",
          "pageref": "page_2"
        }
      ]   
    } 
  }
  </code></pre>
  
  <p>And I am trying to parse is using - </p>
  
  <pre><code>var parsed = JSON.parse(myJson);
  </code></pre>
  
  <p>this throws error at this part - <code>"text": "{\"ip\":\"49.64.194.115\",\"ip_decimal\":75</code></p>
  
  <p>because it is an escaped nested JSON.</p>
  
  <p>How do I do it? I found one method <a href="https://stackoverflow.com/questions/25721164/how-to-fix-an-escaped-json-string-javascript">here</a> but does not apply to this problem.</p>