我需要循環的聯繫總是......沒有停止只是循環請幫我的Javascript環路臨
setTimeout(doSomething, 5000); function doSomething() {
document.getElementById('myAnchor').innerHTML="Visit Google"
document.getElementById('myAnchor').href="http://www.google.com"
setTimeout(doSomething1,5000); } function doSomething1() {
document.getElementById('myAnchor').innerHTML="Visit Me"
document.getElementById('myAnchor').href="http://www.stackoverflow.com"
setTimeout(doSomething2, 5000); } function doSomething2() {
document.getElementById('myAnchor').innerHTML="Visit None"
document.getElementById('myAnchor').href="" }
也許把'doSomething2'中的超時放在'doSomething'開始的地方? – Bergi
[Fornat your code](http://jsbeautifier.org/)請適當!這是不可讀的!它。 – Bergi
不要自己重複功能。 [讓電腦爲你做。](http://en.wikipedia.org/wiki/Don't_repeat_yourself) –