angularJS ajax call fails 403 but jQuery ajax call works for cross-site templateUrl loading. -
this question has answer here:
to test angularjs, took following code right "wire backend" example off http://angularjs.org/ home page. when views local works expected when move views url 403. see jsbin example here:
http://jsbin.com/olavok/1/edit
options ... 403 (forbidden) angular.min.js:99 xmlhttprequest cannot load .... origin http://jsbin.com not allowed access-control-allow-origin.
however, jquery works fine. right in same jsbin added jquery ajax call , see jquery success in logs. if @ result see jquery delivered view.
any thoughts on how angular play nice cross site? read angular using "jquery light" dom. there way angular fall-back , use jquery ajax?
it appears design: http://docs.angularjs.org/api/ng.$http
read section on cross site request forgery (xsrf) protection
.
i noticed 403 coming options verb, not get. jquery works because get, angular's $http
seems play rules:
angularjs performs options http request cross-origin resource
Comments
Post a Comment