Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73935

ElectonJs base64 image src - Failed to load resource

$
0
0

In an electronJs app, I am trying to load a base64 image using the a dynamically created image tag. Appending the base64 string to image tag and appending it to the container using the method insertAdjacentElement(). I have tried setting the source using template string approach, concatinating no success.

When i run the app and perform the action of appending the image. In the console I get the error: Failed to load resource: net::ERR_FILE_NOT_FOUND I have tried numerous base64 string but that is always the outcome.

const imgTemplate: HTMLImageElement = document.createElement('img') as HTMLImageElement;
                    imgTemplate.src = base64; // declared variable container base64 string

                    if(this._appThumbnailContainer) {
                        this._appThumbnailContainer.insertAdjacentElement('beforeend', imgTemplate)
                    }

Below is a screen of the html in the DOM. enter image description here


Viewing all articles
Browse latest Browse all 73935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>