title: Javascript: Replace backslashes with double backslashes
body: <p>I'm currently having the problem mentioned in the title and I'm somehow not finding a way to properly replace backsashes with double backslashes, so that I can properly give the string to a webservice as parameters.
  Let me show you what I tried. Some of these do actually work for some other people, but not for me... I'm currently testing this with FF18.0.1</p>
  
  <pre><code>WSParameters.replace(/\\/g, "\\\\\\\\");
  WSParameters.replace("\\", "\\\\\\\\");
  WSParameters.replace(/\\/g, "\\\\");
  WSParameters.replace(/\\/g, "&amp;#92;&amp;#92;");
  WSParameters.replace(/\\/g, "&amp;#92;");
  WSParameters.replace("\\", "\\\\");
  </code></pre>
  
  <p>Thanks a lot in advance</p>
  
  <p>EDIT: I should mention that it's somehow parsed into JSON and with firebug I see the backslash in the source string, but not in the JSON view. Maybe there is another way? But somehow it's already failing at the replacement of the backslashes.</p>
  
  <p>EDIT2:</p>
  
  <pre><code>if (noAction == false) {
      $.ajax({
          type: "POST",
          url: "WebService.asmx/" + webMethod,
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          async: pAsync,
          data: WSParameters,
          success: function callFunction(result) { processPOSTResults(result, pType, pNot);},
          error: function (xhr, ajaxOptions, thrownError) {
              alert('Error while communicating with WebAdmin web service. - ' + xhr.status + " " + thrownError);
          }
      });
  }
  </code></pre>