как вариант
<iframe class="frame"></iframe><br/>
<button class="start">start</button>
<button class="stop">stop</button>
<input class="inp"/>
<script>
window.onload = function () {
var frame = document.getElementsByClassName("frame")[0];
var start = document.getElementsByClassName("start")[0];
var stop = document.getElementsByClassName("stop")[0];
var inp = document.getElementsByClassName("inp")[0];
var int;
var src = "some.php?param=";
var mas = ["abc", "bcd", "cde", "def"];
var len = mas.length;
start.addEventListener("click", function () {
clearInterval(int);
var param = inp.value;
var index;
int = setInterval(function () {
index = mas.indexOf(param);
if (index == -1) {
param = mas[0];
}
frame.src = src + param;
console.log("index=" + index + "; param=" + param);
if (index == len - 1) {
param = mas[0]
} else {
param = mas[index + 1];
};
}, 1000);
});
stop.addEventListener("click", function () {
clearInterval(int);
});
}
</script>
some.php
<?php
echo $_GET["param"];
?>