Skip to content

Commit

Permalink
Switch .innerText DOM output to .textContent
Browse files Browse the repository at this point in the history
.innerText started as an IE-ism, but .textContent is the WC3 standard. Eventually, IE9+ supported textContent, but Firefox stood firm (or "stubborn") on NOT supporting innerText. As stands, innerText will break this example for modern Firefox browsers, and I don't believe that punishing IE8 users is necessarily a bad thing. ;)

Mind, there's ways to normalize use of this property for maximum browser compat, but I believe the spirit of this example is to keep the code as lean as possible.
  • Loading branch information
Markleford committed Apr 20, 2014
1 parent a353a7a commit d54cec6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/chat/client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ cloak.configure({
messages: {
chat: function(msg) {
var message = document.createElement('div');
message.innerText = msg;
message.textContent = msg;
message.className = 'msg';
messages.appendChild(message);
messages.scrollTop = messages.scrollHeight;
},
userCount: function(count) {
counter.innerText = count;
counter.textContent = count;
}
},
});
Expand Down

0 comments on commit d54cec6

Please sign in to comment.