I got this HTML image item:
<img class="profile-photo img-responsive img-circle" id="imagen_perfil_banner" src="{{ asset('admin/img/profile1.jpg') }}" >
Then I got the JS that changes the src attribute of the image like this:
document.getElementById("imagen_perfil_banner").src = info[13];
The info[13] variable has the next information:
{{ asset('admin/img/1.jpg') }}
When tha page loads, it just doesn't show the image that I send via JS, but when I put the image directly on the image src attribute, it loads just fine.
srcattribute? what data representation is this{{ asset('admin/img/1.jpg') }}?{{ asset('admin/img/1.jpg') }}must be processed first in the backend before it will be sent to the client/browser. So assigning{{ asset('admin/img/1.jpg') }}via javascript and expecting it to pull the image asset from the backend is impossible since browser will treat it as a string{{ asset('admin/img/1.jpg') }}seems to be some sort of javascript that needs to be pre-processed, which will have the value of the return ofasset('admin/img/1.jpg')call