Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
How can I display individual products on my page

I just started full stack development and I'm currently working with node, js and django. On my home page I have 2 products(express) but when I click on an individual product I get redirected to a blank page and I'm not sure why

Here is my code for individual product

window.onload = ()=>{
    let params = window.location.search;
  let urlParams = new URLSearchParams(params);
  let productID = urlParams.get("id");
  // http://127.0.0.1:8000/api/products/id 
  if(productID != null && typeof(productID)!= 'undefined'){
      fetch('http://127.0.0.1:8000/api/products/'+productID)
      .then(resp => resp.json())
      .then(data => {
          console.log(data);
          if('detail' in data){
              // display some generic product not found error
          }
          else{
              let name = data['name'];
              let desc = data['description'];
              let price = data['price'];
              let image= data['image'];
                            // display the product data 
                            
          }
      });
  }
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda