epiz_28063674
website : michaelsbookcorner.com
302 Redirect as determined from Chrome Developer Tools
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://infinityfree.net/errors/404/ with MIME type text/html. See Chrome Platform Status for more details.
What am I trying to do?
I would like to keep a .csv data file with my website which I will update periodically with new blog posts containing Titles, publication dates, URLs, thumb image Urls etc.
I would like my page /with JavaScript fetch to access this data to pull relevant information such information for the latest 5 posts to be displayed in that page.
I’m a bit new to this HTTP request stuff and understand the security issues somewhat. However, there must be a way for me to access files stored on the server where my website resides, with the proper access/ passwords/ tokens, whatever.
How do I set this up now and in the future to take advantage of HTTP requests for accessing centralized data files such as .csv, text, etc, and read their data?
I have included my attempt here below – crude as it is. I believe I had it working well enough locally(and without local server) but now on the website server there are problems.
async function blogData () {
var opts = {
mode:‘no-cors’,
credentials: ‘same-origin’
}
const response = await fetch("https://michaelsbookcorner.com/HTML-blog/2021-blog-record.csv", opts);
const data = await response.text();
console.log("ID","PAGECREATED","UPLOAD","DATE","TITLE","TOPIC","KEYWORDS","URL","FILENAME","ABSTRACT");
const blogPostArray = [];
const table = data.split('\n').slice(1);
table.forEach(row => {
console.log(row);
const columns = row.split(',');
const id = row[0];
const pageCreated = row[1];
const upload = row[2];
const date = row[3];
const title = row[4];
const author = row[5];
const topic = row[6];
const keyWord1 = row[7];
const keyWord2 = row[8];
const keyWord3 = row[9];
const keyWord4 = row[10];
const keyWord5 = row[11];
const keywords = [keyWord1,keyWord2,keyWord3,keyWord4,keyWord5];
const postURL = row[12];
const fileName = row[13];
const imageURL = row[14];
const abstract = row[15];
console.log(id, pageCreated, upload, date, title, author, topic, keywords, postURL, fileName, imageURL, postAbstract);
});
}