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
blank bootstrap cards are showing before my db images

I've got an online store webpage using nodejs, express and mongodb so i have uploaded the image url's, title, description... into my database but the problem is that on webpage it is showing 2 black cards before each image i will show you guys the code below:
Check out the image below

index.js

    var express = require('express');
var router = express.Router();
var Product = require('../models/product')
/* GET home page. */
router.get('/', function(req, res, next) {
   Product.find(function(err, docs) {
    var productChunks = [];
    var chunkSize = 3;
    for (var i = 0; i < docs.length; i += chunkSize){
      productChunks.push(docs.slice(i, i + chunkSize));
    }
    res.render('shop/index', { title: 'Shopping Cart', products: productChunks });
  });
});

module.exports = router;

index.hbs

{{# each products}}
<div class="d-flex justify-content-between mt-3">
   {{# each this}}
   <div class="card" style="width: 18rem;">
      <img class="card-img-top" src="{{this.imagePath}}" alt="image">
      <div class="card-body">
         <h5 class="card-title">{{this.title}}</h5>
         <p class="card-text">{{this.description}}</p>
         <div class="d-flex justify-content-between align-items-center">
            <div class="price">{{this.price}} $</div>
            <a href="#" class="btn btn-primary"><i class="fa fa-shopping-cart" aria-hidden="true"></i> Buy</a>
         </div>
      </div>
   </div>
   {{/each}}
</div>
{{/each}}

error below: Click for image

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Double check source where you upload images and load images, you can use developer tools in browser > network and check does the images load or not there's contain information about url, status, payload and others.

about 4 years ago · Juan Pablo Isaza Report
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!