title: Get the length of jQquery Ajax Response
body: <p>I need to count the length of an Ajax response done in jQuery. The response is in JSON format and only contains a single string. I get the value but have no idea how to count the length of this string.</p>
  
  <p>Here's my code :</p>
  
  <pre><code>var tempId;
  $.ajax({
      url: "&lt;?=base_url();?&gt;index.php/sell/decoder",
      type: "POST",
      data: {'str' : sometext},
      dataType: 'json',
      async: false,
      success: function(response) {
          tempId = response; // This gives me a return value as a string. For example = 153
          alert(tempId.length); // But this returns "undefined". What should I do to get the length?
      }
  });
  </code></pre>
  
  <p>Here's the structure of the response header:</p>
  
  <pre><code>Connection  Keep-Alive 
  Content-Length  2
  Content-Type    text/html
  Date    Fri, 06 Jul 2012 08:12:12 GMT
  Keep-Alive  timeout=5, max=86
  Server  Apache
  X-Powered-By    PHP/5.3.10
  </code></pre>