getting json data from POST
<p>console.log(data) gives the following results</p>

<pre><code>{
    "ERRORS": [
        {
            "MESSAGE": "Error on API.",
            "CODE": "hermes05"
        }
    ],
    "DATA": {}
}
</code></pre>

<p>When I try to get the value message out I get undefined, why?</p>

<pre><code>error: function(data){

  console.log(data.ERRORS[0].MESSAGE);

}
</code></pre>

<p>FULL CODE</p>

<pre><code> $.ajax({
                type: "POST",
                dataType: "json",
                url: "http://api.domain.com/something",
                data: {
                    // Send value in mobile input field.
                    mobile:  $("#mobileNo").val()
                },

                success: function(data){

                },

        error: function(data){

             console.log(data.ERRORS.MESSAGE);

                }
            });


            // stop button from submitting.
            event.preventDefault(); // cancel default behavior
        });
</code></pre>
