JavaScript string replacement problem
<p>I'm doing some string replacement on text I'm getting back from a JSON web service, the string may look like this:</p>

<pre><code>"Hello I am a string.\r\nThis is a second line.\r\n\r\nThis is a bigger space"
</code></pre>

<p>I want to replace all the <code>\r\n</code> with <code>&lt;br /&gt;</code> tags so that the HTML is formatted, but when I do:</p>

<pre><code>var string = result.replace('\r\n','&lt;br /&gt;');
</code></pre>

<p>I only get the first instance replaced, not any other.</p>

<p>What am I doing wrong?</p>
