I am working on a sharepoint online site. and i want to integrate with the following BBC RSS feed service to get the latest news items https://feeds.bbci.co.uk/news/uk/rss.xml. so i wrote the following javascript code:-
<div id="inserhere"></div>
<script src="https://***.sharepoint.com/Resources/jquery-1.11.3.js"></script>
<script>
$(function () {
//feed to parse
var feed = "https://feeds.bbci.co.uk/news/uk/rss.xml";
var html="<div ></div>";
$.ajax(feed, {
accepts:{
xml:"application/rss+xml"
},
dataType:"xml",
success:function(data) {
$(data).find("item").each(function () { // or "item" or whatever suits your feed
var el = $(this);
var nurl = el.find("link").text();
var ntitle = el.find("title").text();
var nurl2 = el.find("link").text();
html+="<div style='float: left;margin-left:9px' ><img style='height:90px;width:185px' src='"+nurl+"' alt='ntitle'><br/><span style='font-size:9px'><a target='_blank' href='"+nurl2+"'>"+ ntitle+"</a></span></div>";
});
$("#inserhere").after(html);
}
});
});
</script>
but i got the following error inside my IE F12 tools:-
HTML1506: Unexpected token.
File: testrf.aspx, Line: 878, Column: 1
SEC7118: XMLHttpRequest for https://feeds.bbci.co.uk/news/uk/rss.xml required Cross Origin Resource Sharing (CORS).
File: testrf.aspx
SEC7120: Origin https://****.sharepoint.com not found in Access-Control-Allow-Origin header.
File: testrf.aspx
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
File: testrf.aspx
SEC7118: XMLHttpRequest for https://browser.pipe.aria.microsoft.com/Collector/3.0/?qsp=true&content-type=application%2Fbond-compact-binary&client-id=NO_AUTH&sdk-version=ACT-Web-JS-2.9.0&x-apikey=c6c190a1b73c4a63bba89835d546cf28-f2a0482f-a00d-48d9-822e-e89cc89eb64d-7688 required Cross Origin Resource Sharing (CORS).
File: testrf.aspx
SEC7118: XMLHttpRequest for https://browser.pipe.aria.microsoft.com/Collector/3.0/?qsp=true&content-type=application%2Fbond-compact-binary&client-id=NO_AUTH&sdk-version=ACT-Web-JS-2.9.0&x-apikey=c6c190a1b73c4a63bba89835d546cf28-f2a0482f-a00d-48d9-822e-e89cc89eb64d-7688 required Cross Origin Resource Sharing (CORS).
File: testrf.aspx
SEC7118: XMLHttpRequest for https://graph.microsoft.com/v1.0/me/photo/$value required Cross Origin Resource Sharing (CORS).
File: TokenFactoryIframe
SEC7119: XMLHttpRequest for https://graph.microsoft.com/v1.0/me/photo/$value required CORS preflight.
File: TokenFactoryIframe
SEC7118: XMLHttpRequest for https://browser.pipe.aria.microsoft.com/Collector/3.0/?qsp=true&content-type=application%2Fbond-compact-binary&client-id=NO_AUTH&sdk-version=ACT-Web-JS-2.9.0&x-apikey=c6c190a1b73c4a63bba89835d546cf28-f2a0482f-a00d-48d9-822e-e89cc89eb64d-7688 required Cross Origin Resource Sharing (CORS).
File: testrf.aspx
SEC7118: XMLHttpRequest for https://fpc.msedge.net/r.gif?MonitorID=O365se&rid=ec41f08a9acf085315004b3e8d984112&w3c=true&prot=https:&v=2018031301&tag=[{"TenantId":"c1bd3148-6e58-45da-b15b-837aeb5d94af"}]&DATA=[{"RequestID":"3226166819aff7c5611b8ac1b78bea0a","Object":"trans.gif","Conn":"cold","Result":1122,"T":1},{"RequestID":"3226166819aff7c5611b8ac1b78bea0a","Object":"trans.gif","Conn":"warm","Result":176,"T":1},{"RequestID":"outlook.office.com","Object":"trans.gif","Conn":"cold","Result":113,"T":1},{"RequestID":"outlook.office.com","Object":"trans.gif","Conn":"warm","Result":112,"T":1},{"RequestID":"outlook.live.com","Object":"trans.gif","Conn":"cold","Result":466,"T":1},{"RequestID":"outlook.live.com","Object":"trans.gif","Conn":"warm","Result":105,"T":1}] required Cross Origin Resource Sharing (CORS).
File: testrf.aspx
SEC7118: XMLHttpRequest for https://browser.pipe.aria.microsoft.com/Collector/3.0/?qsp=true&content-type=application%2Fbond-compact-binary&client-id=NO_AUTH&sdk-version=ACT-Web-JS-2.9.0&x-apikey=c6c190a1b73c4a63bba89835d546cf28-f2a0482f-a00d-48d9-822e-e89cc89eb64d-7688 required Cross Origin Resource Sharing (CORS).
File: testrf.aspx
so can anyone advice on this please? why i am getting errors? although if i type the RSS feed url http://feeds.bbci.co.uk/news/uk/rss.xml inside my IE browser, i can see the news feed without any problem.
User contributions licensed under CC BY-SA 3.0