I am a total amateur to Firebase. My short-term objective here is to read data from a text file that I uploaded onto Firebase. This is the code (copy-pasted from the docs):
storageRef.child('images/stars.jpg').getDownloadURL().then(function (url) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onload = function(event) {
var blob = xhr.response;
};
xhr.open('GET', (/*here I put the url of the file*/));
xhr.send();
});
I am at odds from here. How do I read this file and copy the text into my page? Is my code correct so far?
Thanks.