I have an online sharepoint site, I use ads. These are the ads that I would like to use in the Cordova application, as well as on the HTML5 website, which I have on some information screens.
I studied using the REST service and applications for sharepoint.
Example:
var requestUri = 'https://site.sharepoint.com/_api/web/lists(guid\'someGuid')/items'; var requestHeaders = { 'accept': 'application/json;odata=verbose' }; $.ajax( { url: requestUri, contentType: 'application/json;odata=verbose', headers: requestHeaders, success: function (response){ console.log(response); }, error: function(error) { console.log(error); } });
When I run this, I get: The requested resource does not have an Access-Control-Allow-Origin header. Therefore, the original "null" is not allowed.
I know that I can try to enable CORS on sharepoint or use JSONP.
I was wondering if the path I'm currently following is the right path, or would it be better to create my own WebService and get the data through this?
Any better ways?
thanks
source share