jQuery Ajax Error Response Contains The Success Response
<p>This is a confusing one for me. When I run an ajax request it's always returning an error, but checking the response the data in the responseText is actually the data I need. So why is it reaching the error?</p>

<pre><code>$.ajax({
    type: "GET",
    url: "/getjson.php?name=jay",
    dataType: "json",

    success: function(msg){
            alert(msg);
    },
    error: function(msg) {
            alert("Error: " + msg.responseText);
    }

    });
</code></pre>
