내가 더 스톱으로 만 반복 ... 항상 연결 고리를 필요 밖으로자바 스크립트 루프 프로
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="" }
'doSomething'으로 시작되는'doSomething2'에 타임 아웃을 넣을 수 있습니까? – Bergi
[Fornat your code] (http://jsbeautifier.org/)를 적절히 작성하십시오! 이것은 읽을 수 없다! 그것. – Bergi
직접 기능을 반복하지 마십시오. [컴퓨터가 당신을 위해 그것을 할 수있게하십시오.] (http://en.wikipedia.org/wiki/Don't_repeat_yourself) –