Skip to content

Instantly share code, notes, and snippets.

@Bajena
Created July 4, 2017 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bajena/81099b43c7e974fe3be6fe8fe199b459 to your computer and use it in GitHub Desktop.
Save Bajena/81099b43c7e974fe3be6fe8fe199b459 to your computer and use it in GitHub Desktop.
XHR breakpoints demo
setInterval(function() {
var x = getRandomInt(0, 100);
$('#numbers').append(x).append("<br/>");
}, 1000);
setInterval(function() {
fetch('https://www.random.org/integers/?num=1&min=0&max=100&col=1&base=10&format=plain&rnd=new').then(function(response){
return response.text();
}).then(function(number) {
$('#numbers').prepend("<br/>").prepend(number);
});
}, 2000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment