title: How to make string campatible for JSON.parse()
body: <p>In my application when I enter value as <strong>my"name</strong> in text field the framework makes a String like (<strong>this i can not control</strong>):</p>
  
  <pre><code>"[{\"id\":\"201500000001002\",\"name\":\"my\"name\",\"colorCode\":\"\",\"version\":\"11\",\"nodeOrder\":\"1\"}]"
  </code></pre>
  
  <p>Now this String is passed to JSON.parse() method which produces an error because of ambiguous name field as</p>
  
  <blockquote>
    <p><strong>\"name\":\"my\"name\"</strong>    </p>
  </blockquote>
  
  <pre><code>var str = JSON.parse("[{\"id\":\"201500000001002\",\"name\":\"my\"name\",\"colorCode\":\"\",\"version\":\"11\",\"nodeOrder\":\"1\"}]")
  </code></pre>
  
  <p>This results in JSON exception</p>
  
  <p>Is there anything I can do with the string: </p>
  
  <pre><code>"[{\"id\":\"201500000001002\",\"name\":\"my\"name\",\"colorCode\":\"\",\"version\":\"11\",\"nodeOrder\":\"1\"}]"
  </code></pre>
  
  <p>To escape double quote character in <code>my " name</code> as <code>my \" name</code> to make it valid for JSON.parse method. </p>
  
  <p>I can not control JSON String, I am just passing name as my"name and framework creates a String which is passed to JSON.parse()</p>