title: Get response parameter value in ajax
body: <p>I've wrote a snippet for axis room API. While passing the json for testing, I have got <strong>Cross-Origin Request Blocked</strong> error.</p>
  
  <p>At the same time console shows: <code>{"message":"Could not parse the message.","status":"Error"}</code>. (see the below image)</p>
  
  <p><img src="https://i.stack.imgur.com/2hsSa.jpg" alt="enter image description here"></p>
  
  <p>I hasn't solution for Cross-Origin Request Blocked error. But now I want to show the <strong>Could not parse the message</strong> error. How to do that?. Is a good way to solve Cross-Origin Request Blocked error. suggest me please.</p>
  
  <p><strong>My JavaScript code</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function () {
          $('#Button1').click(function () {
              alert('Alter with jQuery Button Clicked');
              alert('Clicked');
              $.ajax({
                  type: 'POST',
                  url: 'http://test.axisrooms.com/api/daywiseInventory',
                  data: '{"accessKey": "7eb228097576abf56968e9845ab51b90","channelId": "103","hotels": [{"hotelId": "2","rooms": [ {"roomId": "1", "availability": [ { "date": "2014-05-30","free": 1},{"date": "2014-05-31","free": 1}]}]}]}',
                  //data: "{accessKey':'cilentAPIKey'}",
                  contentType: 'application/json; charset=utf-8',
                  dataType: 'json',
                  success: function (data) {
                      callback(data);
                      alert('sus'+data.toString());
                  },
                  error: function (response) {
                      //alert(response);
                      //alert('error' + response.valueOf(message));                    
                      alert('An error has occured');
                  }
  
              });
          });
      });
  &lt;/script&gt;
  </code></pre>