1

i am calling web service published on azure site from office 365 it gives me following error.

XMLHttpRequest cannot load https://azuresite.azurewebsites.net/CrmData.svc/AccountSet. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://office365site.sharepoint.com' is therefore not allowed access.

My Code :

$.ajax({
    url: "https://azuresite.azurewebsites.net/CrmData.svc/AccountSet",
    async: false,
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
        showItems(data);
    },
    error:function(jqXHR, textStatus, errorThrown){
                alert(errorThrown);
            }
});
2

Browser is not allowing you to access service which is published on different domain.

following is link of tutorial of how to access cross domain service.

http://www.html5rocks.com/en/tutorials/cors/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.