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

213
Vistas
Is there a way to save previous html page and load it in current page on reload?

I am trying to create a webpage that has links in a table which are linked to modals that pop up when they are pressed. However these links are appended using Jquery

$("table").append('<tr><td><a href="#exampleModal" data-bs-toggle="modal" data-bs-target="#exampleModal">' + ID +"</a></td><td>" + lastName + "</td><td>"
            + firstName + "</td> <td>" + Course + "</td><td>" + Average + "</td></tr>");

when they are first added into the table, the table and link modals are fine, but when the page is reloaded, the appended code loses some of its text

from:

enter image description here

to:

enter image description here

is there someway to fix this? My first initial thought is to overwrite the previous page's html to the current's but I think this is pretty inefficient and im sure there are more efficient ways to do this functionality.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I dont think you can achieve this just using JS. You will have to rely on some storage mechanism . Because we are dealing with page reloads.

  1. Offload some logic to the backend. Keep track of things via cookies(session storage).
  2. Use local storage to keep track of these links.
about 4 years ago · Juan Pablo Isaza Denunciar

0

You will most probably benifit from storing the html data just before your reload action to recall after page reload.

You could store the info in a database, as a cookie, as a session variable or maybe even in a txt file then recall (and optionally delete) the data on page reload.

As Umendra mentioned this is because we are dealing with a page reload.

Another option could be to send the data as form data using php POST to self (although I am aware your op does not mention or tag php)

<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post">

Then recall on post using

<?php echo $_POST['namevaluefromform'] ?>
about 4 years ago · Juan Pablo Isaza Denunciar
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