title: jQuery.parseJSON throws “Invalid JSON” error due to escaped single quote in JSON
body: <p>I’m making requests to my server using <code>jQuery.post()</code> and my server is returning JSON objects (like <code>{ "var": "value", ... }</code>). However, if any of the values contains a single quote (properly escaped like <code>\'</code>), jQuery fails to parse an otherwise valid JSON string. Here’s an example of what I mean (<a href="https://i.stack.imgur.com/jKAtL.png" rel="noreferrer">done in Chrome’s console</a>):</p>
  
  <pre><code>data = "{ \"status\": \"success\", \"newHtml\": \"Hello \\\'x\" }";
  eval("x = " + data); // { newHtml: "Hello 'x", status: "success" }
  
  $.parseJSON(data); // Invalid JSON: { "status": "success", "newHtml": "Hello \'x" }
  </code></pre>
  
  <p>Is this normal? Is there no way to properly pass a single quote via JSON?</p>