OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <div id="result">Running...</div> | 4 <div id="result">Running...</div> |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 var repeat = 0; | 6 var repeat = 0; |
7 var regex = new RegExp("#repeat(\\d+)"); | 7 var regex = new RegExp("#repeat(\\d+)"); |
8 var match = regex.exec(location.hash); | 8 var match = regex.exec(location.hash); |
9 if (match) | 9 if (match) |
10 repeat = parseInt(match[1]); | 10 repeat = parseInt(match[1]); |
11 | 11 |
12 if (repeat === 100) { | 12 if (repeat === 100) { |
13 document.getElementById("result").innerHTML = "Done."; | 13 document.getElementById("result").innerHTML = "Done."; |
14 parent.document.iframeFinished(); | 14 parent.document.iframeFinished(); |
15 } else { | 15 } else { |
16 new Worker("worker-reload.js"); | 16 new Worker("worker-reload.js"); |
17 location.href = "worker-reload-iframe.html#repeat" + (repeat + 1); | 17 location.href = "worker-reload-iframe.html#repeat" + (repeat + 1); |
18 setTimeout('location.reload()', 1); | 18 setTimeout('location.reload()', 1); |
19 } | 19 } |
20 </script> | 20 </script> |
21 </body> | 21 </body> |
22 </html> | 22 </html> |
OLD | NEW |