You are not logged in.
When I use a $http object from AngularJS to get info about an AUR item, I get the error:
XMLHttpRequest cannot load https://aur.archlinux.org/rpc/?args%5B%5D=asdasdasd&type=info&v=5. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
Code in angularjs:
$http.get("https://aur.archlinux.org/rpc/", {params: {v: "5", type: "info", "arg[]": package_name}}).success(function (data) {
Last edited by z3ntu (2016-02-18 09:12:10)
Offline
It works with jsonp.
$http.jsonp("https://aur.archlinux.org/rpc/", {
params: {
v: "5",
type: "info",
"arg[]": input,
callback: "JSON_CALLBACK"
}
}).success(function (data) {
$scope.timeout = null;
$scope.valid_package = data.resultcount != 0;
});
Offline