Creating a json obj from a string when working without a net connection?
<p>I have a json object returned from a third party api, it looks like:</p>

<pre><code>{"version":"1.0","encoding":"UTF-8"}
</code></pre>

<p>I'm going to be working on my project without a network connection, so I have to do everything locally. How can I create an instance of a json object locally for testing? Say I copy the above string, can I do something like:</p>

<pre><code>var json = null;
if (debugging_locally) {
    json = new jsonObj('{"version":"1.0","encoding":"UTF-8"}');
}
else {
    json = doAjaxCall();
}

doStuffWithJsonObj(json);
</code></pre>

<p>so I just want to create a json object from a stored string if debugging locally - how can I do that?</p>

<p>Thanks</p>
