www/js/client.js
// Write something to the screen, scroll to bottom and limit number of rows.
Write something to the screen, scroll to bottom and limit number of rows.
Write something to the screen scroll to bottom and limit number of rows .
function writeToScreen(str) {
  if (str && str.length > 0) {
    var out = document.getElementById('out');
    out.insertAdjacentHTML('beforeend', str);
    out.scrollTop = out.scrollHeight;
    while(out.childNodes.length > 1000) out.childNodes[0].remove();
  }
}
function writeToScreen ( str ) { if ( str && str . length > 0 ) { var out = document . getElementById ( 'out' ) ; out . insertAdjacentHTML ( 'beforeend' , str ) ; out . scrollTop = out . scrollHeight ; while ( out . childNodes . length > 1000 ) out . childNodes [ 0 ] . remove ( ) ; } }
Write something to the screen, scroll to bottom and limit number of rows.
Write something to the screen scroll to bottom and limit number of rows .