In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to use Blob in Js". In daily operation, I believe many people have doubts about how to use Blob in Js. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to use Blob in Js"! Next, please follow the editor to study!
In general Web development, Blob is rarely used, but Blob can meet the special needs of some scenarios. An abbreviation for Blob,BinaryLargeObject, which represents a large object of binary type. The concept of Blob is used in some databases. For example, the BLOB type in MYSQL represents a container for binary data. In Web, an object of type Blob represents immutable raw data similar to a file object. In popular terms, a Blob object is binary data, but it is binary data similar to a file object, so you can manipulate a Blob object like a File object. In fact, File inherits from Blob.
Basic usage of Blob
Create
You can create a Blob object through the constructor of Blob:
Blob (blobParts [, options])
Blob parameter description:
BlobParts: array type in which each item in the array is concatenated to form the data of the Blob object. Each element in the array can be ArrayBuffer (binary data buffer), ArrayBufferView,Blob,DOMString. Or other similar objects.
Options: optional, dictionary format type, you can specify the following two attributes:
Type, which defaults to "", represents the MIME type of the contents of the array that will be put into blob.
Endings, which defaults to "transparent", is used to specify how the string containing the line Terminator\ nis written. It is one of two values: "native", which means that the line Terminator will be changed to a newline character that is appropriate for the host operating system file system, and "transparent", which means that the Terminator saved in blob will be left unchanged.
Take a chestnut:
Vardata1= "a"
Vardata2= "b"
Vardata3= "Thisisablob"
Vardata4= {"name": "abc"}
Varblob1=newBlob ([data1])
Varblob2=newBlob ([data1,data2])
Varblob3=newBlob ([data3])
Varblob4=newBlob ([JSON.stringify (data4)])
Varblob5=newBlob ([data4])
Varblob6=newBlob ([data3,data4])
At this point, the study on "how to use Blob in Js" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.