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

300
Views
When loading data from php onto a page that automatically refreshes is not rememering that a row was hidden by the client device

I have an annoying issue where once the client device has hidden data using:

echo "function hideReq";
echo $row['requestID'];
echo "() {";
echo "var x = document.getElementById('play";
echo $row['requestID'];
echo "');";
echo "if (x.style.display === 'none') {";
echo "x.style.display = 'block';";
echo "} else {";
echo "x.style.display = 'none';";
echo "}";

The code above adds the script dynamically through the same PHP that adds the ID's data so that each ID's data can be affected by the script itself.

It is unset once the data has been refreshed through php using:

$(document).ready(function(){
function getData(){
$.ajax({
type: 'POST',
url: 'locationData.php',
success: function(data){
$('#dataoutput').html(data);
}
});
}
getData();
setInterval(function () {
getData(); 
}, 120000);  // it will refresh your data every 3 mins
});

The code above gets the data from an external PHP document that is added to a div on the page on a 3-minute cooldown.

To clarify, the code works as expected. Once the refresh cooldown has been reached the data loads as it is meant to. However, the hidden rows are once again visible.

I just need to know how to either;

  1. Make it so that the data requests only the data with the IDs that are not already on the device so that it can remember the hidden rows
  2. Add a method that will still refresh all of the data and also keep the rows hidden. Whichever is easier.
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!