title: Javascript JSON Object replace string within object
body: <p>Ok, I have a large multidimensional JSON object being poured into my app, of which one of the objects is an html string, for creating links. Now I have no ability to change the output of this Object currently to replace what I want to with what I need to because this object is used in a couple places through out a few different applications. Of which works fine up til now.</p>
  
  <p>What I need to do is replace a small piece of this html string in the JSON object to alter it so it fits the needs of this new application.</p>
  
  <p>The HTML within the object looks like (taken directly from firebug console under "response tab" less the whole object data)</p>
  
  <pre><code>&lt;a href='\/ng\/other\/?object_id=6bfb00fb-2b76'&gt;Some Text&lt;\/a&gt;
  </code></pre>
  
  <p>What I need to do is replace the "ng" and "other" within that string to something else entirely. To which I have tried.</p>
  
  <pre><code>var swapVal1 = data.rows[index1].vals[1].replace(\/ng\/other\/,"/new/placement/");
  </code></pre>
  
  <p>However I get SyntaxError: illegal character Line 31 and its pointing to the first piece of the replace function. So, what is it I would need to do, in order to handle this properly for the time being until other things can be rewritten on the back end as a better alternative to this problem.</p>