AnsweredAssumed Answered

Cross-Site Get request

Question asked by seif on Mar 2, 2016
Latest reply on Sep 26, 2016 by seif
Hi everybody,
I try to invoke a repository webscript from share in ajax call
<javascript>
Alfresco.util.Ajax.request({
           
            url: "http://127.0.0.1:8080/alfresco/s/sample/groups/getUserGroups",

            method: Alfresco.util.Ajax.GET,

            dataObj: {
                username: "seif",
                nodeRef: "workspace://SpacesStore/7589fe98-c111-4948-910e-68e5d2643590"
            },
             successCallback: {

                  fn: function(res) {
                     if (res.json !== undefined)
                     {
                        var results = res.json;
                        alert(results);
                     }
                  },

            }
});
</javascript>

but i have this error in browser console
XMLHttpRequest cannot load http://127.0.0.1:8080/alfresco/s/sample/groups/getUserGroups?username=seif&…deRef=workspace%3A%2F%2FSpacesStore%2F7589fe98-c111-4948-910e-68e5d2643590. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:9080' is therefore not allowed access.
Help pleaze.

Outcomes