title: WebSQL injection prevention with Javascript
body: <p>I've search around but not found an answer to this one.</p>
  
  <p>Is there a function in Javascript similar to PHP's <code>mysql_real_escape_string</code> to make safe user inputs before writing them to a WebSQL database?</p>
  
  <p>If not, does anyone know of a custom made function out there that I could use?</p>
  
  <p>UPDATE:
  So it seems like there is no native function, so I have written:</p>
  
  <pre><code>function sql_real_escape_string(val){
      var val = val.replace('"','&amp;quot;');
      val = val.replace('\'','&amp;rsquo;');
      return val;
  }
  </code></pre>
  
  <p>Are there any other characters that I should be replacing to be on the safe side?</p>