- 10
- 0
- 约8.14千字
- 约 24页
- 2017-10-07 发布于河南
- 举报
js判断大全(JS judgment book)
js判断大全(JS judgment book)
*
Determines whether the specified content is empty. If it is empty, pop up the warning box
* /
Function isEmpty (theValue, strMsg) {
If (theValue== ) {
Alert (strMsg+ cant be empty);
Return true;
}
Return false;
}
*
Chinese judgment function allows shengpizi with * instead of English
The return TRUE indicates the condition, and the return false indicates no agreement
* /
Function isChinese (STR) {
Var badChar = ABCDEFGHIJKLMNOPQRSTUVWXYZ;
BadChar = abcdefghijklmnopqrstuvwxyz;
BadChar = 0123456789;
BadChar + = + ; / / half width and full width space
BadChar = @#$%^ ` ~! (); \\, -_=+]\\|: \ ? ; / / / does not contain the symbol English * or.
If (==str) {
Return false;
}
For (VaR i=0 I VaR; C = str.charAt (I); / / string character in str
If (badChar.indexOf (c) -1) {
Return false;
}
}
Return true;
}
*
The numeric judgment function returns true, indicating all the digits, and returns false, indicating that all numbers are not numbers
* /
Function isNumber (STR) {
If (==str) {
Return false;
}
Var reg = /\D/;
Return str.match (reg) ==null;
}
*
Determines whether a given string is a specified length
Is to return true, not to return false
* /
Function isNumber_Ex (STR, len) {
If (==str) {
Return false;
}
If (str.length, =len) {
Return false;
}
If ((isNumber (STR)) {
Return false;
}
Return true;
}
*
Money judgment function, allow the first - said to owe
Returns true indicating the correct format and returns false indicating a format error
* /
Function isMoney (STR) {
If (==str) {
Return false;
}
For (VaR, i=0, I, VaR, C = str.charAt (I));
If (i==0) {
If (C = ! - (c 0 ||c 9)) {
Return false;
}else if (c== - - str.length==1) {
Return false;
}
}else if (C 0 || C 9) {
Return false;
}
}
Return true;
}
*
English judgment function, return true, that is all in English, return false, not all in English
* /
Function isLetter (STR) {
If (==str) {
Return false;
}
For (VaR, i=0, I, VaR, C = str.charAt (I));
If ((c a ||c Z (c) and A ||c Z)) {
Return false;
}
您可能关注的文档
- 2010年全国自考基础会计学模拟试卷(七)(2010 national self taught basic accounting simulation paper (seven)).doc
- 2010gaokaoti(2010gaokaoti).doc
- 2010年中考复习整理初一初二思品练习卷(2010 exam review, finishing the first two days of thinking quality exercises).doc
- 2010年广州中考数学模拟试题八(In 2010, Guangzhou high school mathematics simulation test questions eight).doc
- 2010.06.03材质笔记(2010.06.03 material notes).doc
- 2010年度感动中国十大人物事迹及颁奖词(Deeds and awards speech of moving China's ten great figures in 2010).doc
- 2010年拆迁办上半年总结和下半年工作重点(2010 demolition work in the first half of the summary and focus of the second half of the work).doc
- 2010年基本能力试题特点(Basic ability examination questions in 2010).doc
- 2010年江苏省苏州市中考物理试题及答案(Physics examination questions and answers in Suzhou City, Jiangsu Province in 2010).doc
- 2010年2月互联网上刚出炉的50个段子(February 2010, the Internet just released 50 scripts).doc
最近下载
- 高考英语应用文-倡议书(讲义)-高三英语上学期一轮复习专项.pdf VIP
- 珠宝销售提升方案.pptx VIP
- 2025年AI大模型训练数据质量与模型性能提升策略报告.docx VIP
- 人音版六年级下册《游子吟》课件(共13张PPT无音频)(含音频+视频).ppt VIP
- 《阀门专题讲座》课件.pptx VIP
- “三级”安全教育记录卡(范本).doc VIP
- SHT3904-2014 石油化工建设工程项目竣工验收规定.pdf VIP
- JTGT3334-2018公路滑坡防治设计规范[高清版].pdf VIP
- 导管堵塞、冲封管及生活指导.pptx VIP
- 高中数学概率计算练习题及答案.doc VIP
原创力文档

文档评论(0)