The websites I'm talking about are codecademy.com and tryruby.org .
My guess would be that the console is a simple div with key listeners connected to it. Whenever the user presses any key and sends it by pressing enter, the console simply adds everything that he typed after the last letter in the div , and βmovesβ the >> [type here to the last line of the div .
However, I am not sure that it is that simple, so I would like to know what other people think. I believe that this would be too inefficient - especially when we are talking about a situation where the entire console is too full of text - adding any character to the last line and moving the rest of the text, then it takes too much time for the browser to process.
javascript jquery ruby
biphobe
source share