Appending EJS partial with jQuery

I'm trying to use JQuery to append an EJS partial. What I want to do is to implement infinite scrolling in a table - I am using EJS to render the table's rows as partials and within each partial using more EJS to display the variables passed into the view from Express.

table.html

<tbody>
  <% include row.html %>
</tbody>

row.html

<% users.forEach(function(user){ %>
  <td><%= user.name %></td>
  ...and so on
<% }) %>

jQuery

$('tbody').append('<%- include row.html %>')

The issue I'm having now is that I can't get the last <% include row.html %> to work in the jQuery. I have debugged this and isolated the issue to this line of code. What can I do to make this work?

Thanks!

我来评几句
登录后评论

已发表评论数()

相关站点

+订阅
热门文章