0

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?

1 Answer 1

1
var image ="<img src='/uploads/" + myImage + "' alt='image in infowindow'>"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.