<スクリプト タイプ="text/javascript"> $.fn.extend({ displayPart:function () { var displayLength = 100; displayLength = this.attr("displayLength") || displayLength; var text = this.text(); if (!text) return ""; var count = 0; (var i = 0; i < ; displayLength; i ) { var _char = text.charAt(i); if (count >= displayLength) if (/[^x00- xff]/.test(_char) ) count ; //全角文字, //[u4e00-u9fa5] 中国語
result = count ; result.length < text.length ) { result = "..." this.text(result)