Tengo muchos autos leídos de back4app, solo cuando hago clic en el nombre de un auto me llevan a car_detail.html y agregan mi plantilla html de los detalles del auto en el que se hizo clic y cuando hago clic en otro auto me llevan a la misma página pero con detalles. de segundo coche. este es el enlace de mi sitio para ser más
(async () => { const query = new Parse.Query('cars'); // You can also query by using a parameter of an object const results = await query.find(); try { for (const cars of results) { // Access the Parse Object attributes using the .GET method const obj = cars.set('objectId'); const brand = obj.get('car_brand'); const year = cars.get('car_year'); const seat =cars.get('car_seat'); const fuel =cars.get('fuel_type'); const speed = cars.get('car_speed'); const consume=cars.get('car_consume'); const price =cars.get('car_price'); let sub_brand=brand.substring(0,2); $(".cars").append(`<tr> <td> <a id="${brand}${year}" class="d-flex align-items-center brand"> <div class="mr-10"><div class="btn btn-circle d-flex btn-info text-white">${sub_brand}</div> </div> <div class=""> <h4 class="mb-0 font-16">${brand}</h4> </div> </a> </td> <td>${year}</td> <td class="col-sm-1">${seat}</td> <td> <label id="fuel-color" class="badge rounded-pill bg-warning">${fuel}</label> </td> <td>${consume} Km/1litres</td> <td><label class="badge bg-danger">${speed}</label></td> <td> <h5 class="mb-0">${price} TND</h5> </td> </tr>`); $("#"+brand+year).attr(`href`,`car_details.html#`+brand+year); } } catch (error) { console.error('Error while fetching cars', error); } })(); async()=>{ const query = new Parse.Query('cars'); const results = await query.find(); for (const cars of results) { const brand = obj.get('car_brand'); const year = cars.get('car_year'); $(document).on('click', '#'+brand+year,async function(){ let r = await fetch("html_fetch/car_detail_view.html"); let t = await r.text(); $(`.car_details_view`).append(t); }); }}