Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
133 views
in Technique[技术] by (71.8m points)

javascript - Response data not rendering despite request being passed through

I am trying to render template data on my front end with ejs. This is currently my template:

<% data.urls && data.urls.countries.forEach(function (countries) { %>
    <div class="card">
     <div class="card-body">
      <h3>Country Name: <img alt="" src="<%=Country.icon %>" /> <%= countries.name %></h3>
      <h5>Categories</h5>
      <ul>
       <% data.urls.countries.categories.forEach(function(categories){ %>
        <li><%= categories.name %></li>
       <% }); %>
      </ul>
     </div>
    </div>
    <% }); %>

and I am trying to render that data on the front end through:

<% data.urls && data.urls.countries.forEach(function(countries){ %>
    <%- include ('template', { data: data }); %>    
    <% }); %>

However, when I do so, there is no response. When I view the source code, there is not response, and it appears as if the code which should render the data on the front end (second code block) is not there. There is no error in the console, and I see the request come through the node server, but no response. Any idea?


Example of what I am trying to render is below:enter image description here

question from:https://stackoverflow.com/questions/65876721/response-data-not-rendering-despite-request-being-passed-through

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...