字符串裁剪
? function subStr(str,len){??? ??? if(str.length>len){??? ??? ??? return str.substring(0,len)+"...";??? ??? }??? ??? return str??? ? }
?
调用
<script>document.write(subStr("${nameCn}",7));</script>