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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -