Skip to main content
deleted 159 characters in body
Source Link

Mixed Content XMLHttpRequest cannot load error

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. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://office365site.sharepoint.com' is therefore not allowed access. The response had HTTP status code 501.

My Code :

$.ajax({
    url: "https://azuresite.azurewebsites.net/CrmData.svc/AccountSet",
            crossDomainasync: truefalse,
            contentTypemethod: "application/json; charset=utf-8""GET",
            headers: {
                "accept""Accept": "application/json;odata=verbose,json; */*"odata=verbose" },
      success: function (data) {
       "X-RequestDigest": $("#__REQUESTDIGEST").valshowItems(data);
            },
            success: showItems,
            error:function(jqXHR, textStatus, errorThrown){
                alert(errorThrown);
            }
});

Mixed Content error

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. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://office365site.sharepoint.com' is therefore not allowed access. The response had HTTP status code 501.

My Code :

$.ajax({url: "https://azuresite.azurewebsites.net/CrmData.svc/AccountSet",
            crossDomain: true,
            contentType: "application/json; charset=utf-8",
            headers: {
                "accept": "application/json;odata=verbose, */*",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
            },
            success: showItems,
            error:function(jqXHR, textStatus, errorThrown){
                alert(errorThrown);
            }
});

XMLHttpRequest cannot load error

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);
            }
});
Source Link

Mixed Content error

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. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://office365site.sharepoint.com' is therefore not allowed access. The response had HTTP status code 501.

My Code :

$.ajax({url: "https://azuresite.azurewebsites.net/CrmData.svc/AccountSet",
            crossDomain: true,
            contentType: "application/json; charset=utf-8",
            headers: {
                "accept": "application/json;odata=verbose, */*",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
            },
            success: showItems,
            error:function(jqXHR, textStatus, errorThrown){
                alert(errorThrown);
            }
});