js代码
<script type="text/javascript"> //显示限制输入字符method function textAreaChange(obj){ var $this = $(obj); var count_total = $this.next().children('span').text(); var count_input = $this.next().children('em'); var area_val = $this.val(); if(area_val.len()>count_total){ area_val = autoAddEllipsis(area_val,count_total);//根据字节截图内容 $this.val(area_val); count_input.text(0);//显示可输入数 }else{ count_input.text(count_total - area_val.len());//显示可输入数 } } //得到字符串的字节长度 String.prototype.len = function(){ return this.replace(/[^\x00-\xff]/g, "xx").length; };
申明:本站所有资源都是转载各大下载站,或由网友投稿发布,请自行检测软件的完整性,如有侵权请联系我们删除下架,联系方式:admin@php.cn