js to get data from google sheet for my website and it worked perfectly for 2 months but now stopped working. I'm getting this error:
index.html:1 Access to XMLHttpRequest at 'https://spreadsheets.google.com/feeds/worksheets/1vX54pYMqq_U6QRTn86zsh9wf8uel9Oiku6NZ3bPPBTg/public/basic?alt=json' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm using this script :
<script src='https://cdnjs.cloudflare.com/ajax/libs/tabletop.js/1.5.1/tabletop.min.js'></script>
<script type='text/javascript'>
var publicSpreadsheetUrl = 'https://docs.google.com/spreadsheets/d/1vX54pYMqq_U6QRTn86zsh9wf8uel9Oiku6NZ3bPPBTg/edit?usp=sharing';
function init() {
Tabletop.init( {
key: publicSpreadsheetUrl,
callback: showInfo,
simpleSheet: true
} )
}
function showInfo(data, tabletop) {
alert('Successfully processed!')
console.log(data);
}
window.addEventListener('DOMContentLoaded', init)
</script>
I am not really familiar with backend development so that is why I'm using this as a free and easy cms - I looked for similar questions about it but I cant understand how to fix this since I don't really know how to work with APIs. I would really appreaciate any help - thanks!