I have just come across the concept of inline images. Even if the image file is encoded into base64 for inline images, look at the code below to see the inline problem.
It can reduce http requests, but the disadvantage is that it cannot be cached across domains!
Then how to convert pictures to base64 online
If you only rely on simple javascript, there is js with permission issues does not allow operations on local files or folders for security reasons
Now that HTML5 is here, there is a lot of information on Baidu, including Chinese and w3c documents http://www. w3.org/TR/FileAPI/
Now we use the readAsDataURL function in the file api of html5. This is a function that converts the file into base64 encoding