I'm making a page and want some part of my page is reloading automatically. I'm using window.frame[] in firefox but it doesn't work as per requirement. Could you please assist me in correcting the code?
<div class="col s12 m12 l12 xl12" id="ruangdiskusi">
<iframe src="schedule.php?cd=2" name"iframe" id="diskusi" style="margin-left: 0%; width:100%; height:487px; overflow-y:scroll; padding:5px; background: rgba(0,0,0,0.1); padding:2%;"></iframe>
<script>
var id_lansia = "<?php $queri0="Select * From tb_assistant WHERE id_assistant = '$assistant'";
$proses0=mysqli_query ($connect,$queri0);
while ($data = mysqli_fetch_array ($proses0)){
$idlansia = $data['id_lansia'];
}echo $idlansia;?>"
document.getElementById("diskusi").src = "diskusi.php?cd="+id_lansia;
var element = document.getElementById("diskusi");
$('#diskusi').scrollTo(element.get(0).scrollHeight);
window.setInterval(function() {
reloadIFrame()
}, 3000);
function reloadIFrame() {
console.log('reloading..');
document.getElementsByName('iframe').contentWindow.location.reload();
}
</script>
</div>