title: jquery how to check response type for ajax call
body: <p>How can  I determine the response type of ajax call in Jquery? At times, the server sends json response and at times it sends only the html for display purposes. Right now I am using</p>
  
  <pre><code>if(response.indexOf('Error'))
    //popup error message
  else
   response.username
   response.address
  </code></pre>