-1
Speak guys, I need to include the return of a foreach within the url of a background-image, please can help me:
<!-- Slide 1 -->
<% DTSection0.forEach(function(row){ %>
<div class="item" style="background-image: url(assets/img/site/slider/<%= row.imagem %>)"></div>
<% }); %>
See when placing <%= Row.image %> inside the error url and the image does not click on the page.
I am using Node.JS and my pages are in . ejs.
You can show how the ejs-generated HTML is?
– Sergio
So you’re not returning anything... it’s empty. made a console.log and the query as well as the foreach is ok, the problem is in that part right there to include the <%= Row.image %> inside the url
– Fabio Eduardo Argenton
But appears the
<div class="item"
?– Sergio
you are right Sergio, only one image should be active item, the others have to be only item, I will put here and already put the answer, thanks.
– Fabio Eduardo Argenton