开发者

jquery plugin issues with counting chars when returns are used

I have a problem with jquery.charcounter.js its not counting returns as /r/n its counting them as 1 char instead of 3 or 4 here is the code is there a way around it

            if (el.val().length > max) {
            el.val(el.val().substring(0, max));
            if (settings.pulse &&开发者_开发百科 !p) {
                pulse(container, true);
            };
        };


This really has nothing to do with jQuery or even charcounter, the .length property is purely javascript. As far as I know, \n is always counted as 1 character rather than two. I'm not sure what issue you're running into from this, but you may want to read this post:

String length differs from Javascript to Java code

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜