js 正则表达式
摘要:验证数字:^[0-9]*$ 验证n位的数字:^\d{n}$ 验证至少n位数字:^\d{n,}$ 验证m-n位的数字:^\d{m,n}$ 验证零和非零开头的数字:^(0|[1-9][0-9]*)$ 验证有两位小数的正实数:^[0-9]+(.[0-9]{2})?$ 验证有1-3位小数的正实数:^[0-9
阅读全文
封装cookie
摘要://创建cookie function setCookie(name, value, expires, path, domain, secure) { var cookieText=encodeURIComponent(name)+'='+encodeURIComponent(value); if
阅读全文
ajax请求数据
摘要:封装ajax function ajax_(_type,_url,_data,callback,_dataType){ _dataType=_dataType==undefined?"text":_dataType; $.ajax({ type:_type, url:_url, async:true
阅读全文