title: Removing Some Characters In A JSON Response
body: <p>I have a JSON response as the follwoing, but my problem is there are some characters that is not related to the JSON response I want. So I have pass that JSON response to a JavaScript variable and look into the JSON string. That is at the bottom.</p>
  
  <p>-----------JSON Response------------</p>
  
  <pre><code>{
     "readyState":4,
     "responseText":"&amp;lt;?xml version=\"1.0\"encoding=\"utf-8\"?&amp;gt;\r\n&amp;lt;string&amp;gt;{\"kind\":\"analytics#gaData\",\"id\":\"https://www.googleapis.com/analytics/v3/data/ga?ids=ga:76546294&amp;amp;dimensions=ga:userType&amp;amp;metrics=ga:users&amp;amp;start-date=2014-10-01&amp;amp;end-date=2014-10-23&amp;amp;max-results=10\",\"query\":{\"start-date\":\"2014-10-01\",\"end-date\":\"2014-10-23\",\"ids\":\"ga:76546294\",\"dimensions\":\"ga:userType\",\"metrics\":[\"ga:users\"],\"start-index\":1,\"max-results\":10},\"itemsPerPage\":10,\"totalResults\":2,\"selfLink\":\"https://www.googleapis.com/analytics/v3/data/ga?ids=ga:76546294&amp;amp;dimensions=ga:userType&amp;amp;metrics=ga:users&amp;amp;start-date=2014-10-01&amp;amp;end-date=2014-10-23&amp;amp;max-results=10\",\"profileInfo\":{\"profileId\":\"76546294\",\"accountId\":\"289147\",\"webPropertyId\":\"UA-289147-1\",\"internalWebPropertyId\":\"456104\",\"profileName\":\"US - Institutional Investors - NP Microsite\",\"tableId\":\"ga:76546294\"},\"containsSampledData\":false,\"columnHeaders\":[{\"name\":\"ga:userType\",\"columnType\":\"DIMENSION\",\"dataType\":\"STRING\"},{\"name\":\"ga:users\",\"columnType\":\"METRIC\",\"dataType\":\"INTEGER\"}],\"totalsForAllResults\":{\"ga:users\":\"1110\"},\"rows\":[[\"New Visitor\",\"826\"],[\"Returning Visitor\",\"284\"]]}&amp;lt;/string&amp;gt;",
     "status":200,
     "statusText":"OK"
  }
  </code></pre>
  
  <p>-----------End of JSON ------------</p>
  
  <p>I want to remove these characters from the beginning of the string:</p>
  
  <pre><code>`{"readyState":4,"responseText":"&lt;?xml version=\"1.0\"encoding=\"utf-8\"?&gt;\r\n&lt;string&gt;`
  </code></pre>
  
  <p>And I want to remove these character from the end of the string:</p>
  
  <pre><code>`&lt;/string&gt;","status":200,"statusText":"OK"}`
  </code></pre>
  
  <p>So I want to remove these characters. I think a set of JavaScript String functions to be used. But I don't know how to mix them and use.</p>
  
  <p>Could someone help me to solve this matter?</p>
  
  <p>Thanks and regards,
  Chiranthaka</p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>I have used the follwoing AJAX function to send and get the JSON response back.</p>
  
  <pre><code>function setJsonSer() {
                  formData = {
                  'Email': 'clientlink@site.com',
                  'Password': 'password1234',
                  'URL': getVaria()
              };
                  $.ajax({
                  url: "/APIWebService.asmx/AnalyticsDataShowWithPost",
                  type: 'POST',
                  data: formData,
                  complete: function(data) {
              var jsonResult = JSON.stringify(data);
              alert(JSON.stringify(data));
  
              Load(data);
  
                  }
              }); 
      }
  </code></pre>
  
  <p><strong><em>UPDATE 02</em></strong></p>
  
  <pre><code>function setJsonSer() {
                  formData = {
                  'Email': 'clientlink@russell.com',
                  'Password': 'russell1234',
                  'URL': getVaria()
              };
                  $.ajax({
                  url: "/APIWebService.asmx/AnalyticsDataShowWithPost",
                  type: 'POST',
                  data: formData,
              dataType: 'json',
                  complete: function(data) {
              var jsonResult = JSON.stringify(data);
  
              alert(jsonResult);
  
              Load(data);
  
                  }
              });                 
  
      }
  </code></pre>