var image ="<img src='/uploads/" + myImage + "' alt='image in infowindow'>"
How to use correct syntax in javascript-events variables in a HTML document?
-
03-10-2022 - |
문제
In my script, I am using this code to get an image:
var image ="<img src='/uploads/carImage.png' alt='image in infowindow'>"
This works perfectly well and the carImage
is displayed, but what I want to do, is to exchange carImage
with a variable like:
var myImage = "carImage.png"
var image ="<img src='/uploads/myImage' alt='image in infowindow'>"
I understand, I need a specific syntax for myImage, but I am not able to find it. So my question is: What is the correct syntax for the variable myImage inside the variable image?
해결책
제휴하지 않습니다 StackOverflow