A typo in my code:
Code:
setTimeout( functiion() { document.this_form.submit3.disabled = false; }, 10000 );
"functiion" should be "function".
This page works for me:
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<iframe id="myframe"></iframe>
<form name="this_form" method="GET" action="">
<input type="button" name="submit3" value="Submit" onclick="loadNextPage(1)">
</form>
<script type="text/javascript">
var cnt=0,webpageArray = [
"http://cnn.com/",
"http://rapidcashgpt.com/",
"http://codingforums.com"
];
function loadNextPage(dir) {
cnt += dir;
// this can never happen: if (cnt<0) cnt=webpageArray.length-1; // wrap
if (cnt>= webpageArray.length) {
alert("we are done");
return;
}
var iframe = document.getElementById("myframe");
iframe.src = webpageArray[cnt];
document.this_form.submit3.disabled = true;
setTimeout( function() { document.this_form.submit3.disabled = false; }, 10000 );
}
loadNextPage(0); // actually loads first page
</script>
</body>
</html>