`

JS通用库函数

阅读更多
1.ifLetter            判断字符串是否都是英文字母
2.trim                正则表达式去除左右空格
3.validateEmail       正则表达式Email验证
4.ifExists            判断某个元素是否存在于数组中
5.countLength         限制最大字符输入,若输入框中的字符长度超出则提示
6.getlinks        获取页面所有链接
7.getimgpic        获取页面所有图片地址
8. PageCheck       页码验证
9.isGBK         判断字符中是否有汉字
10.isDigit        检查是否为数字
11.get_star        根据生日判断属于哪个星座
12.document.onreadystatechange   文档是否加载完成
13.AddEvent           给元素添加事件
14. radio_init        单选框初始化
15.checkbox_init      复选框初始化
16.isNull             判断是否为空
17.add_option         添加select的option
18.HTMLEncode         替换特殊字符
19.window.document.oncontexttmenu  屏蔽鼠标右键
20.window.document.onselectstart   对象选择事件  
21.window.document.onkeydown   屏蔽F5 刷新,退格删除键 对控件为 text 
textarea password    无效
22.KillErrors        屏蔽js错误
23.check_all         全选(复选框)
24.uncheck_all       反选(复选框)
25.ValidateBadWords  检测内容是否有非法字符
26.CheckUpload       验证上传的图片
27.setCookie         添加cookie
28.getCookie         得到cookie
29.deleteCookie      删除cookie
30.findPosX          取得对象在IE窗口的x坐标
31.findPosY          取得对象在IE窗口的y坐标
32.in_array          判断字符串a是否包含s
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics