Page is a not externally linkable
Fotiman - 7:40 pm on Nov 28, 2012 (gmt 0)
Note, even if you have that if clause, it will still update every 10ms as long as the textarea has a value that is truthy (resolves to "true" when used as a boolean).
Instead, what you want to do is store the "last known value" of the textarea, and then test to see if the value is different. For example:
var lastValue = '';
function displayResult() {
if (textarea.value !== lastValue) {
lastValue = textarea.value;
iframe.open();
iframe.write(textarea.value);
iframe.close();
}
window.setTimeout(displayResult, 10);
}