I know it's a common question, and also I have already read a lot of discussions before starts this.
I have an iframe (inside a div) that show part of an external website. If I stay on my page, the website inside my iframe refresh the data every 30 seconds. If I don't stay on the page, the page will not auto refresh every 30.
My focus is to refresh the iframe every 10 seconds, so I'm sure that what I see is update.
That's my index.htm but I'm not sure if it works. Do you find any errors in the iframe refresh part?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TITLE</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
div{
width:1000px;
height:450px;
position:relative;
border: 1px solid black;
overflow:hidden;
margin-right: auto;
margin-left: auto;
}
iframe{
position:absolute;
width:1280px;
height:1400px;
top:-915px;
left:-240px;
}
</style>
</head>
<body>
<div>
<iframe name="myIframe" src="https://website.com" scrolling="no" frameborder="no"> </iframe>
</div>
<script>
window.setInterval("reloadIFrame();", 10000);
function reloadIFrame() {
document.frames["myIframe"].location.reload();
}
</script>
</body>
</html>