I have the following page
<!DOCTYPE html>
<html>
<script type="text/javascript">
function loopLink(i)
{
window.open($('#iframe_a').contents().find('.image-navigator-mid a').attr('href'),'iframe_a');
setTimeout(function()
{
if (i < 3) loopLink(i+1);
}, 5000);
}
// Wait for the page to load first
window.onload = function() {
var a = document.getElementById("mylink");
a.onclick = function() {
loopLink(0);
return false;
}
}
</script>
<iframe src="http://nanofate.us/content/fate-new-hair-style#node-inner" width="500" height="500" name="iframe_a" id="iframe_a"></iframe>
<br />
<a id="mylink" href="">Execute</a>
the idea is that in it's current form, when you click Execute, the javascript will cause the iframe to use the "previous" link 4 times, waiting 5 second each time, however when i click the link it just reloads the page and even after waiting 10 seconds the iframe is doing nothing
i am wondering what i have done wrong