title: How to replace an apostrophe in a string in Javascript?
body: <p>Given a string in Javacript, such as</p>
  
  <pre><code>var str = "this's kelly";
  </code></pre>
  
  <p>I want to replace the apostrophe (') with another character. Here is what I've tried so far:</p>
  
  <pre><code>str.replace('&amp;quot;', 'A');
  str.replace('\'', 'A');
  </code></pre>
  
  <p>None of these work.</p>
  
  <p>How do I do it?</p>
  
  <p>Can you also please advices me with the invalid characters  that when passed to the query string or URL crashes the page or produces undesired results ? e.g passing apostrophe (') produces undesired result are their any more of them.</p>