惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
T
Threatpost
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Recorded Future
Recorded Future
小众软件
小众软件
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
博客园 - 聂微东
美团技术团队
F
Fortinet All Blogs
I
InfoQ
U
Unit 42
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
GbyAI
GbyAI
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
H
Help Net Security
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
aimingoo的专栏
aimingoo的专栏
C
Check Point Blog
Jina AI
Jina AI
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 叶小钗
Recent Announcements
Recent Announcements
D
DataBreaches.Net
IT之家
IT之家
雷峰网
雷峰网
Y
Y Combinator Blog
W
WeLiveSecurity
P
Proofpoint News Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
月光博客
月光博客
The Hacker News
The Hacker News

博客园 - 宽田

SQLite在.NET中自适应32位/64位系统 OWIN是什么? 好的用户界面-界面设计的一些技巧 Android模拟器连接本李服务器localhost win7 64位 VS2010调试提示“ORA-12154: TNS: 无法解析指定的连接标识符”的解决方法 Javascript技巧 解释器模式(interpreter): 访问者模式(Visitor) 职责链模式(Chain of Responsibility) Web Service 中返回DataSet结果大小改进 通用数据链接(UDL)的用法 ORACLE WITH AS 用法 Oracle REGEXP_INSTR 用法 C# 实现自定义事件 错误:200, Stream not found, NetStream.Play.StreamNotFound, clip: '[Clip] GetCallbackEventReference(客户端调用服务器端)的用法 wcf Svcutil用法 IIS 增加net.tcp绑定 客户端字符集NLS_LANG
Js 验证中文字符长度
宽田 · 2013-08-13 · via 博客园 - 宽田

Posted on 2013-08-13 16:46  宽田  阅读(676)  评论(0)    收藏  举报

代码如下:

  //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;
    }