Free webinar! How to Make Generative AI Work for You
Get my free ticket+ 7
Line 9: The URL path "rainbow.jpg" does not exist.
Try adding the following constant and update the line with the fetch as follows:
const rainbow = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Double-alaskan-rainbow.jpg/400px-Double-alaskan-rainbow.jpg"
fetch(rainbow)
Line 14: The Url object should be all caps:
Change:
.src=Url.createObjectURL(blob)
To:
.src=URL.createObjectURL(blob)
+ 5
David Carroll
You are absolutely correct, my last comment was not necessary, good catch
Coder
My bad on the half-ass advice.
I will remove my earlier replies
+ 3
Coder What specifically are you trying to do? I'm not sure what you mean by:
"how to take data off text file?"
+ 2
Coder Line 14 still needs to be updated.
Use the following:
document.getElementById("rainbow").setAttribute("src",URL.createObjectURL(blob));
or
document.getElementById("rainbow").src = URL.createObjectURL(blob);
+ 2
Coder What I'm trying to figure out is, what you want to do after you fetch the text file?
Do you plan to read the text file and output the contents to the web page or maybe save to a database?
Or will you save the file to disk?
I'm just trying to get the bigger picture to give the proper response.
0
Helli