代码如下:
//Oracle Varchar2 一个中文对应3个Byte,所以用3个x替换 var commentValue = commentValue.replace(/[^\x00-\xff]/g, "xxx"); if (commentValue.length > 500) { alert("Max length is 150 Chinese or 500 English"); return false; }
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3