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
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 answers
Answer question

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 Report

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 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!