- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
js数据验证(JS data validation)
js数据验证(JS data validation)
/ * *
* get long characters in Chinese and English
* @param str {}
* @return {}
* /
Function LengthB (STR) {
Var P1 = new RegExp (%u..,g)
Var P2 = new RegExp (%.,g)
Return, escape (STR),.Replace (P1, ),.Replace (P2, ),.Length
}
/ * *
* filtering all space characters
* @param, {Object}, str
* /
Function jsTrim (STR) {
= str;
While ((str.charAt (0) = = ) || (str.charAt (0) = = ??? || (escape) (str.charAt (0)) = =%u3000))
STR = str.substring (1, str.length);
While ((str.charAt (str.length - 1) = = (str.charAt) || (str.length - 1) = =??? || (escape) (str.charAt (str.length - 1)) = =%u3000))
STR = str.substring (0, str.length - 1);
Return str;
}
/ * *
* filtering intermediate strings and multiple spaces
* @param, {Object}, inputString
* /
Function trim (inputString) {
If (typeof inputString = = string) {
Return inputString;
}
Var retValue = inputString;
Var ch = retValue.substring (0, 1);
While (CH = = {)
The beginning of a blank check string / /
RetValue = retValue.substring (1, retValue.length);
Ch = retValue.substring (0, 1);
}
Ch = retValue.substring (retValue.length - 1, retValue.length);
While (CH = = {)
Check the string / / the end part of the space
RetValue = retValue.substring (0, retValue.length - 1);
Ch = retValue.substring (retValue.length - 1, retValue.length);
}
While (retValue.indexOf () = = -1 ) {
Text / / intermediate multiple connected spaces into a space
RetValue = retValue.substring (0, retValue.indexOf ()) + retValue.substring (retValue.indexOf ()) + 1, retValue.length);
}
Return retValue;
}
/ * *
* filter string specified filter content, if the content is empty, the default filter @#$%^* (-+.) ~
* @param, {Object}, str
* @param, {Object}, filterStr
*
* @return contains filter content, returns True, otherwise returns false;
* /
Function FilterStr (STR, filterStr) {
FilterStr = filterStr = = ? ~! @#$%^* (-+.\): filterStr
Var ch;
Var i;
Var temp;
Var error = false; / / when contains illegal characters, return True
For (I =
您可能关注的文档
- 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
- 2010年潍坊事业单位真题(部分)(2010 Weifang institutions Zhenti (part)).doc
- “正德厚生,臻于至善”:中国移动企业文化建设的探索与实践.docx
- 纳米复合介质受潮后的耐电性能蜕变与吸潮机制探秘.docx
- 一种基于Sorting机制的偶图模型检测工具的设计与实现.docx
- 华南理工大学数字图书馆信息资源建设项目管理的深度剖析与策略优化.docx
- 平台艺术:开启艺术大众化新时代.docx
- 百合抗病基因类似物克隆及杂种胚培珠离体培养技术的协同创新研究.docx
- 詹姆斯·菲什金协商民主理论探析.docx
- 经济法视域下政府诚信的多维审视与建设路径.docx
- 血管内热交换下不同低温治疗对犬重型颅脑外伤脑保护作用的比较研究.docx
- 白藜芦醇抗急性痛风性关节炎:疗效剖析与机制探寻.docx
原创力文档


文档评论(0)