Skip to content

Commit

Permalink
jQuery .bind changed to .on
Browse files Browse the repository at this point in the history
Line 54 - minor efficiency update, faster to declare all vars outside
of your loops.

bindEvents() - Updated from .bind to .on - it appears your supporting
jQuery 1.7.2 and up, so this should be fine since its supported 1.7+
  • Loading branch information
Chris authored and Chris committed Mar 22, 2015
1 parent 216a69e commit 575391b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jquery.charactercounter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@

function customFields(params)
{
var html='';
var i, html='';

for (var i in params)
for (i in params)
{
html += ' ' + i + '="' + params[i] + '"';
}
Expand Down Expand Up @@ -118,10 +118,10 @@
function bindEvents(element)
{
$(element)
.bind("keyup", function () {
.on("keyup", function () {
checkCount(element);
})
.bind("paste", function () {
.on("paste", function () {
var self = this;
setTimeout(function () { checkCount(self); }, 0);
});
Expand Down

0 comments on commit 575391b

Please sign in to comment.