I have tested this code on firefox and it only gets up to "pat2". IE is the same. In Chrome it runs fine and runs indefinitely.
Is it obvious as to why this is the case? Firebug does not show any errors and the loading icon keeps showing it is working on something.
<script type="text/javascript">
i = 1
function writeurl(){
document.write("pat"+i+"<br>")
i+=1
setTimeout(writeurl,1000)
}
writeurl()
</script>
If it only ran once, perhaps I could attribute it to something I did wrong, but it runs twice then "stops" without error.
Also it may help to know that the following works fine and it keeps running until the callstack overflows. ;)
<script type="text/javascript">
i = 1
function writeurl(){
document.write("pat"+i+"<br>")
i+=1
writeurl()
}
writeurl()
</script>