V
V
volucris12021-03-07 13:32:49
Node.js
volucris1, 2021-03-07 13:32:49

How can I get .ejs with the right parameters?

I have an .ejs file that receives data from Node.js from MySql:

<% let max = 10;%>
<% for(let i = 0; i < max; i++) {%>
  <%= results[i]['about'] %>
<% } %>

It displays the description of the article.
I need to click on the button, using (probably fetch), make a request to the server to give me this .ejs file, but the max variable has become 20, and the i variable has taken the value of the last loaded article (as I understand it, it will be max ). Question: How do I get .ejs but with a different variable?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question