Response provides multiple promise-based methods to access the body in various formats: For instance, lets get a JSON-object with latest commits from GitHub: Or, the same without await, using pure promises syntax: To get the response text, await response.text() instead of .json(): As a show-case for reading in binary format, lets fetch and show a logo image of fetch specification (see chapter Blob for details about operations on Blob): We can choose only one body-reading method. We create the FileReader instance and set the onloadend property to a function that gets the base64 string from reader.result. javascript. There are several ways to do this. This is inefficient and can result in a poor user experience. by invoking ReadableStreamDefaultReader.releaseLock(). Example: The following code is an example of . Maybe that is not correct. Not the answer you're looking for? By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. To fix this, add the following two lines at the bottom of your code (just above the closing tag) to load verse 1 by default, and make sure the element at any time is the same as the text inside the selected