Skip to content

Instantly share code, notes, and snippets.

@colby-swandale
Created July 13, 2016 08:33
Show Gist options
  • Save colby-swandale/9100ceba64a0edb556e5399a46ef40d0 to your computer and use it in GitHub Desktop.
Save colby-swandale/9100ceba64a0edb556e5399a46ef40d0 to your computer and use it in GitHub Desktop.
<html>
<head>
<script>
var xhr = new XMLHttpRequest(),
method = 'GET',
url = 'http://localhost:8000/test.php';
xhr.open(method, url, true);
xhr.onprogress = function() {
console.log(xhr.responseText);
};
xhr.send();
</script>
</head>
<body>
</body>
</html>
<?php
ob_start();
while(true) {
echo "test";
ob_flush();
sleep(1);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment