How To Parse A String Of Concatenated JSON In Browser?
<p>I'm using Socket.IO to move data to the browser. The data sent is a stream of JSON objects, and when it arrives at the browser, it becomes one large string of JSON. The problem is, this JSON can't be parsed by JSON.parse() because it's not "real" JSON.</p>

<p>The data structure can be arbitrary so a RegEx might not do the trick. And this current setup is only temporary. Eventually this stream of JSON will be pre-processed server-side so a stream will not need to be sent to the browser, so I'd like to keep the AJAX/Socket.IO setup I have right now instead of switching over to a JSON stream parser like <a href="http://oboejs.com/examples" rel="nofollow">OboeJS</a>.</p>

<p>What can I do to parse this string of concatenated JSON?</p>

<p>For clarity, the JSON will look like this:</p>

<pre><code>{"a":"A"}{"b":"B"}{"c":"C"}
</code></pre>

<p>And I'm trying to parse it in such a way that I can access them like:</p>

<pre><code>console.log(Object.a) //A
console.log(Object.b) //B
console.log(Object.c) //C
</code></pre>