Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
how to apply infinite scroll ejs template

I am using nodejs and ejs template for displaying data to frontend but I want to apply infinite scroll on my data which I am getting from nodejs , so how can I do that,

node js code -

app.get("/", (req, res) => {
  //  console.log("got here first");
  const removedData = blogData.filter(
    (element) => element.id > 1 && element.id != 3
  );
  res.render("blog", {
    removedData,
  });
});

Ejs code -

 <div class="article-container">
        <% removedData.forEach((element,index) => { %>
        <div class="small-article">
          <a href="/blogs/<%= element.url %>">
            <div class="article-img">
              <img src="<%= element.mainImg %>" alt="" style="object-fit: cover;" />
              <div class="read-more">
                <p>Read more >></p>
              </div>
            </div>
          </a>
          <div class="article-text-area">
            <div class="text-and-date">
              <h3>Written</h3>
              <span></span>
              <h4><%= element.date %></h4>
            </div>
            <div class="article-content">
              <h3><%= element.heading %></h3>
              <p>
                <%= element.discription.substring(0,100) + "..." %> 
              </p>
            </div>
            <div class="article-author">
              <div class="author-img">
                <img src=<%= element.authorImage %> alt="" />
              </div>
              <div class="author-info">
                <h4><%= element.author %></h4>
              </div>
            </div>
          </div>
          
        </div>
    <% }) %>

And I want to show 4 post at time while scroll please help

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!