I've been receiving error status 'parsererror' while processing json request. How can I resolve this? Snippet:
$.ajax({ url: "../filter/filter.json", dataType: 'json', success: function(data) { if (data.error) { alert(data.error); } // do something with XML document with DOM functions alert('1 data'+data); }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log('err status - '+textStatus); console.log('err thrown - '+errorThrown); } }); Server response {"car":[1, 2, 3]} Here's the headers: Date Sun, 17 Feb 2008 20:00:05 GMT Server Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.2 X-Powered-By PHP/5.2.3-1ubuntu6.2 P3P CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM" Set-Cookie CAKEPHP=deleted; expires=Sat, 17-Feb-2007 20:00:04 GMT; path=/cake/ubpf/ CAKEPHP=ad9d9413ee4077380bd2f51a1f726a63; path=/cake/ ubpf/ CAKEPHP=5d5b12573bd29f9d941d758e957d2047; path=/cake/ubpf/ CAKEPHP=ad9d9413ee4077380bd2f51a1f726a63; path=/cake/ubpf/ Pragma no-cache Cache-Control no-store, no-cache, max-age=0, must-revalidate X-JSON {"car":[1, 2, 3]} Content-Length 33 Keep-Alive timeout=15, max=97 Connection Keep-Alive Content-Type text/x-json Request Headers Host localhost User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/ 20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12 Accept application/json, text/javascript, */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive X-Requested-With XMLHttpRequest Referer http://localhost/cake/ubpf/schools/index/ Cookie CAKEPHP=5d5b12573bd29f9d941d758e957d2047; JSESSIONID=1ex6vauykextu; CAKEPHP=ba483c7130d486a1afbbcc852ad19241