ruby-grape/grape-on-rack

View on GitHub
public/scripts/stream.js

Summary

Maintainability
A
0 mins
Test Coverage
$(document).ready(function() {

  var stream = function() {
    var client = new XMLHttpRequest();
    client.open('get', '/api/stream');
    client.send();
    client.onprogress = function() {
      $('#stream_value').html($('#stream_value').html() + "<br>" + this.responseText);
    }
  };

  stream();
});