JavaScript native APIs were originally supported, Base64, but because of the limitations of the previous JavaScript, Base64 was largely useless. When the current HTML5 standard is formalized, BASE64 will have a larger transformation space, which can
Always can't remember these two functions, simply write down, better turn.Avascript Native API was originally supported, Base64, but due to the limitations of the previous JavaScript, resulting in Base64 basic see useless. When the current HTML5
Previous wordsBase-64, as a common coding function, has been widely used in Basic authentication, Digest authentication, and some HTTP extensions. In the front-end domain, images are often converted to base-64 encoding for transmission over the
JavaScript converts a base64 image to formData and submits it through AJAX.
Previously, we used the webcam plug-in to take a photo. After taking the photo, we got an image in base64 format. It's okay to directly display it. Just specify it in src,
JavaScript Native provides two Base64 related methods.
btoa(): Any value converted to BASE64 encoding
atob(): Base64 encoding converted to original value
var string = ' Hello world! ' // "SGVSBG8GV29YBGQH"// "Hello world!"Note
In order to take photos of the use of webcam-related plug-ins, its shooting is the base64 format of the picture, direct display no problem, in the SRC directly specified on it, but to upload to the server when the problem comes, the server side
Preview the image before uploading javascript and HTML5I. The FileList object and the file object FileList object indicate the list of files selected by the user. In HTML4, only one file can be placed in the file control, but in html5. by adding the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.