setTimeout(funcA,0)
setTimeout(funcB,0)
setTimeout(funcC,0)
結論としては、予約順でした。
試験ソース
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<title>setTimeout</title> | |
<body></body> | |
<script> | |
resizeTo(200,300) | |
for(var i=0;i<100;i++){ | |
var f=function(){ | |
var div=document.createElement('div') | |
document.body.insertBefore(div) | |
div.innerText = arguments.callee.num | |
} | |
f.num = i | |
setTimeout(f,0) | |
} | |
document.body.onclick=function(){ | |
var arr=document.getElementsByTagName('div') | |
for(var i=0,L=arr.length;i<L;i++){ | |
if(arr[i].innerText != i){return document.title = '順不同['+i+']'} | |
} | |
document.title = 'ok' | |
} | |
</script> | |
</html> |
0 件のコメント:
コメントを投稿