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

205
Views
¿Cómo mostrar la nueva lista desde el almacenamiento local?

¿Cómo visualizo la nueva lista desde el almacenamiento local? Cuando el usuario ingresa una nueva búsqueda, se muestra bien y se agrega al almacenamiento local. Sin embargo, no muestra la lista actualizada en las últimas solicitudes en el sitio web. Actualmente solo lo muestra al refrescar el sitio web. Entonces, básicamente, ¿cómo vuelvo a ejecutar/volver a mostrar la lista nueva y actualizada del almacenamiento local? Puede publicar el HTML si es necesario

 // Local Storage function SaveDataToLocalStorage(data) { var a = []; // Parse the serialized data back into an aray of objects a = JSON.parse(localStorage.getItem('last-requests')) || []; // Push the new data (whether it be an object or anything else) onto the beggining of the array a.unshift(data) // If more than 5 requests remove (pop) last request if (a.length > 5) { a.pop() } // Re-serialize the array back into a string and store it in localStorage localStorage.setItem('last-requests', JSON.stringify(a)); displayLastRequests() };
 // Displays last 5 requests/searches function displayLastRequests() { const lastReq = JSON.parse(localStorage.getItem('last-requests')) console.log(lastReq) // for loop request for (req of lastReq) { var clone = $($("#last-request-template").html()); clone.appendTo(".last-requests"); clone.find(".cityname").text(req.city_name); clone.find(".cityweather").text(req.weather); clone.find(".imgs").attr('src', req.imgurl); clone.find(".citytemp").text(req.city_temp + " °C"); clone.find(".citywind").text(req.city_wind + " m/s"); } };
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!