I have a table that has an href link to a picture/media file. When my page updates the image [media] flashes during the setInterval function. Everything else is fine. How would I stop this from happening?
php code
<?php
include("../lib/config.php");
$conn=mysqli_connect("$dbhost","$dbuser","$dbpass","$dbname");
$result = mysqli_query($conn, " SELECT name, message, time, media FROM message ORDER BY ID DESC");
mysqli_close($conn);
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['message'] . "</td>";
echo "<td>" . $row['time'] . "</td>";
//echo "<td>" . $row['media'] . "</td>";
echo "<td><a href=\"" . $row['media'] . "\" target=\"_blank\" alt=\"Media not available\"> <img src=\"" . $row['media'] . "\" height=\"50\" ></a></td>";
echo "</tr>";
}
?>
js code
<script type="text/javascript">
setInterval(function(){
$.get("../pageLinks/messageOne.php" , function(result){
$("#testMessageOne").html(result);
});
}, 20000);
</script>