| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <title>Massive Memory Leak</title> |
| function loadVideo (videoURI) { |
| var xhr = new XMLHttpRequest(); |
| xhr.open('GET', videoURI, true); |
| xhr.onreadystatechange = function (xhrEvent) { |
| if (xhr.readyState == 3) { |
| var currentLength = xhr.responseText.length; |
| var totalLength = parseInt(xhr.getResponseHeader('Content-Length'), 10); |
| print((Math.round((currentLength / totalLength) * 10000) / 100) + '%'); |
| else if (xhr.readyState == 4) { |
| alert(xhr.responseText.length); |
| function print (message) { |
| document.getElementById('outlet').textContent = message; |
| <a onclick="loadVideo('http://streamos.atlrec.com/download/atlantic/bjork/video/bjork_itunes1.m4v');">do it!</a> |