Js received that the data returned by the background is the garbled image of base64.

use ajax to send a request to the background. The base64 image is returned in the background, but the console prints out a pile of garbled codes. How to parse it? you want to put the returned base64 in the src of img directly

.

clipboard.png
ajax:

clipboard.png
how should this be parsed when the front end receives this

Mar.01,2021

according to the content of the log, the binary stream returned by the background should be a binary stream, and the full-scene random characters + JFIF tag should be able to determine that it is a binary stream of a JPEG file, not base64. So it should be OK to put the code displayed by the binary stream into the callback:

  

I have encountered the same problem as you. I have been reporting mistakes according to the above steps, and I don't know where I wrote wrong. That kind of garbled code is binary code. How can the front end be converted into base64

?
Menu