How can I console.log () create a blob object?

I have a Blob object that I want to check by registering its value. All I see are the type and size properties. Is there any way to do this?

console.logging a blob shows this

+5
source share
1 answer

Basic Example of Using FileReader to View Content in a Block

 var html= ['<a id="anchor">Hello World</a>']; var myBlob = new Blob(html, { type: 'text/xml'}); var myReader = new FileReader(); myReader.onload = function(event){ console.log(JSON.stringify(myReader.result)); }; myReader.readAsText(myBlob); 
+7
source

Source: https://habr.com/ru/post/1210120/


All Articles