Dab tsi yog blob hauv Javascript?
Dab tsi yog blob hauv Javascript?

Video: Dab tsi yog blob hauv Javascript?

Video: Dab tsi yog blob hauv Javascript?
Video: Plob hau hle ntau ntau yog vim li cas?/Cause of alopecia(Hair loss)/ສາເຫດຂອງຜົມຫຼົ່ນ 2024, Kaum ib hlis
Anonim

A Blob yam khoom sawv cev rau cov ntaub ntawv zoo li cov khoom ntawm cov ntaub ntawv raw; lawv tuaj yeem nyeem tau ua ntawv lossis cov ntaub ntawv binary, lossis hloov mus rau ReadableStream yog li nws txoj hauv kev tuaj yeem siv los ua cov ntaub ntawv. Blobs tuaj yeem sawv cev cov ntaub ntawv uas tsis tas yuav nyob hauv a JavaScript - haiv hom ntawv.

Hais txog qhov no, siv blob hauv JavaScript yog dab tsi?

Hauv paus, Blob muab JavaScript qee yam zoo li cov ntaub ntawv ib ntus, thiab URL.createObjectURL() cia koj kho cov neeg ntawd blobs zoo li lawv yog cov ntaub ntawv ntawm lub vev xaib server. Tej zaum koj yuav xav tau xa los ntawm API qhov twg URL xav tau cov ntaub ntawv uas zoo li cov ntaub ntawv.

Ib tug kuj yuav nug, Dab tsi yog A BLOB cov ntaub ntawv hom? A BLOB (binary loj khoom) yog ib tug sib txawv-lengthbinary hlua uas muaj peev xwm mus txog 2, 147, 483, 647 cim ntev. Zoo li lwm yam binary hom , BLOB cov hlua tsis cuam tshuam nrog nplooj ntawv code. Ntxiv rau, BLOB cov hlua tsis tuav tus cwj pwm cov ntaub ntawv.

Ib sab saum toj, blob txhais li cas?

Binary Loj Object

Lub blob URL yog dab tsi?

Blob URLs tuaj yeem tsuas yog tsim tawm sab hauv los ntawm browser. Blob URL / Yam khoom URL yog pseudo raws tu qauv toallow Blob thiab ntaub ntawv cov khoom siv los ua URL sourcefor tej yam xws li dluab, download links rau binary ntaub ntawv thiab soforth.

Pom zoo: