0

As from now you cannot create custom aspx files in SharePoint Online nor edit them with SharePoint designer.

I'm trying to launch an html with some js (angularJs and jquery) from the same site in Sharepoint Online. I'm connecting with some lists through the js but I'm getting constantly a 403 error (I'm site admin). The api call is this -

https://{domain}/sites/Employee_store/_api/web/Lists(guid'ee029e41-ecd4-4589-af56-4aa9db0c9bbc')/Items?$select=Title,Price

It works fine when directly called from the browser and returns data but from my .js it is showing the 403 error. Any Ideas?

Here it is part of the code:

function GetListItems($scope){  
    var formDigestValue = jQuery("#__REQUESTDIGEST").val();
    console.log(formDigestValue);  
    $.ajax({    
        url: _spPageContextInfo.siteAbsoluteUrl+"/_api/web/Lists(guid'ee029e41-ecd4-4589-af56-4aa9db0c9bbc')/Items?$select=Title,Price",
        method: "GET",    
        async: false,    
        headers: { "Accept": "application/json;odata=verbose", "X-RequestDigest": formDigestValue},  
        success: function(data){  
        $scope.ItemsFromOrders= data.d.results;
        },    
        error: function(sender,args){    
            console.log(args.get_message());    
        }    
    });    
}

1 Answer 1

0

You could create a webpart page, insert script editor webpart into webpart page and insert your html/script into script editor webpart directly.

enter image description here

Then your could should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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