3 ms·
So it takes the text as input, and injects that into the frame below. A few times per second. I'm wondering what the use cases for this are? Learning HTML basi
by dazbradbury 15y ago
So it takes the text as input, and injects that into the frame below. A few times per second.
I'm wondering what the use cases for this are? Learning HTML basics?
I think http://jsfiddle.net/ http://jsfiddle.net/ does this and a lot more.
- artursapek 15y agoI think it probably updates on keydown, not several times per second.
- dazbradbury 15y ago> I think it probably updates on keydown, not several times per second. This seems to be the relevant code (note that it calls update once every 150ms): function update() { var textarea = window.editbox.document.f.ta; var d = dynamicframe.document; if (old != textarea.value) { old = textarea.value; d.open(); d.write(old); if (old.replace(/[\r\n]/g,'') == defaultStuff.replace(/[\r\n]/g,'')) d.write(extraStuff); d.close(); } window.setTimeout(update, 150); }
- jaredsohn 15y agoOne problem with this versus jsfiddle.net is that if your code shows an alert, it will show it again after every keydown.