ajax - Angularjs $http "XML Parsing Error: no element found Location" error when expecting JSON results on GET -



ajax - Angularjs $http "XML Parsing Error: no element found Location" error when expecting JSON results on GET -

when submit angularjs $http phone call receive xml parsing error.

the $http phone call code snippet is:

$http({ method: 'get', url: "myapp/api/items" + itemid });

the error is:

xml parsing error: no element found location: moz-nullprincipal:{f191853f-5581-b049-b83f-5f4b69211adb} line number 1, column 1:

the info beingness returned json. if set url in browser request submitted , response info comes in browser.

i tried adding responsetype: 'json' (and responsetype: 'application/json') $http phone call no success. (i referenced usage section in angularjs http doc determine how configure call.)

is there way can forcefulness response info recognize json avoid error?

if using mozilla firefox, install firebug , seek inspect http in net panel or in console panel.

in headers tab can check content-types beingness sent , received. maybe problem in server-side response's content-type.

ajax json angularjs

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -