国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
常用JS
/*** 刪除首尾空格 ***/
String.prototype.Trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
/*** 統(tǒng)計指定字符出現(xiàn)的次數(shù) ***/
String.prototype.Occurs = function(ch) {
// var re = eval("/[^"+ch+"]/g");
// return this.replace(re, "").length;
return this.split(ch).length-1;
}
/*** 檢查是否由數(shù)字組成 ***/
String.prototype.isDigit = function() {
var s = this.Trim();
return (s.replace(/\d/g, "").length == 0);
}
/*** 檢查是否由數(shù)字字母和下劃線組成 ***/
String.prototype.isAlpha = function() {
return (this.replace(/\w/g, "").length == 0);
}
/*** 檢查是否為數(shù) ***/
String.prototype.isNumber = function() {
var s = this.Trim();
return (s.search(/^[+-]?[0-9.]*$/) >= 0);
}
/*** 返回字節(jié)數(shù) ***/
String.prototype.lenb = function() {
return this.replace(/[^\x00-\xff]/g,"**").length;
}
/*** 檢查是否包含漢字 ***/
String.prototype.isInChinese = function() {
return (this.length != this.replace(/[^\x00-\xff]/g,"**").length);
}
/*** 檢查是否有列表中的字符字符 ***/
String.prototype.isInList = function(list) {
var re = eval("/["+list+"]/");
return re.test(this);
}
/*** 簡單的email檢查 ***/
String.prototype.isEmail = function() {
var strr;
var mail = this;
var re = /(\w+@\w+\.\w+)(\.\w*)(\.\w*)/i;
re.exec(mail);
if(RegExp.!="" && RegExp.!="." && RegExp.!=".")
strr = RegExp.+RegExp.+RegExp.;
else
if(RegExp.!="" && RegExp.!=".")
strr = RegExp.+RegExp.;
else
strr = RegExp.;
return (strr==mail);
}
/*** 簡單的日期檢查,成功返回日期對象 ***/
String.prototype.isDate = function() {
var p;
var re1 = /(\d)[年./-](\d)[月./-](\d)[日]?$/;
var re2 = /(\d)[月./-](\d)[日./-](\d)[年]?$/;
var re3 = /(\d)[月./-](\d)[日./-](\d)[年]?$/;
if(re1.test(this)) {
p = re1.exec(this);
return new Date(p[1],p[2],p[3]);
}
if(re2.test(this)) {
p = re2.exec(this);
return new Date(p[3],p[1],p[2]);
}
if(re3.test(this)) {
p = re3.exec(this);
return new Date(p[3],p[1],p[2]);
}
return false;
}
//驗證手機號
function isMobileNum(num){
var reg = /^((13[0-9]{1})|(15[0, 8, 0]{1})){1}\d{8}$/;
if (reg.test(num)){
return true;
}else{
return false;
}
}
//簡單驗證是否包含特定字符
var   num   =   "023456789";
if(num.indexOf("23")   !=   -1)
{
alert('包含');
}
//實現(xiàn)頁面的自動跳轉(zhuǎn) IE、Firefox都適用
<script type="text/javascript">
location.href="index.action";
</script>
//控件是否存在
<script type="text/javascript">        var   a=   document.getElementById("dd");
if(a==null)
{
//ddd
}
</script>
//獲取頁面的URL
//如果獲取“當(dāng)前”域名,當(dāng)頁面A包含在頁面B中時,在A中使用此方法返回的是A的地址
host = window.location.host;
url=document.domain;
url = window.location.href; //獲取瀏覽器地址欄中url地址
top.location
thisURL = document.URL;
//http://localhost:81/Test/1.htm?Did=123
thisHREF = document.location.href;
//http://localhost:81/Test/1.htm?Did=123
thisSLoc = self.location.href;
//http://localhost:81/Test/1.htm?Did=123
thisDLoc = document.location;
//http://localhost:81/Test/1.htm?Did=123
thisTLoc = top.location.href;
//http://localhost:81/Test/1.htm?Did=123
thisPLoc = parent.document.location;
//http://localhost:81/Test/1.htm?Did=123
thisTHost = top.location.hostname;
// localhost
thisHost = location.hostname;
// localhost
thisU1 = window.location.protocol;
// http:
thisU2 = window.location.host;
// localhost:81
thisU3 = window.location.pathname;
// /Test/1.htm
GOOGLE 日歷API地址http://code.google.com/intl/zh-CN/apis/calendar/
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
再次擴展 JavaScript 的 trim 函數(shù)
js string 函數(shù)大全
javascript中對變量類型的判斷
Javascript 深拷貝
通過 Object.prototype.toString.call() 進行類型判斷
javascript常用工具類和公共方法合集
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服