|
|
|
commonuse.js
darknight @ 2009-6-25 17:05:00
commonuse.js -- 包含一些常用的函数
Array对象
-
- Array.prototype.shift();
-
-
- Array.prototype.push();
-
-
-
- Array.prototype.compose(arg,[func]);
-
-
- Array.prototype.moveFirst();
-
-
- Array.prototype.moveLast();
-
-
- Array.prototype.moveNext();
-
-
- Array.prototype.movePrevious();
Number对象
-
- Number.prototype.outBetween(min,max);
-
-
- Number.prototype.between(min,max);
String对象
-
- String.prototype.leftContain(str);
-
-
- String.prototype.contain(str);
-
-
- String.prototype.trim
-
-
- String.prototype.ltrim
-
-
- String.prototype.rtrim();
-
-
- String.prototype.replaceAll(fnd,rep);
-
-
- String.prototype.changeToDate();
Date对象
-
- Date.prototype.equalYear(ydate);
-
-
- Date.prototype.equalMonth(mdate);
-
-
- Date.prototype.equalDate(ddate);
-
-
- Date.prototype.equal(date);
-
-
- Date.prototype.betweenYear(minYDate,maxYDate);
-
-
- Date.prototype.betweenMonth(minMDate,maxMDate);
-
-
- Date.prototype.between(minDate,maxDate);
-
-
- Date.prototype.outBetween(minDate,maxDate);
-
-
- Date.prototype.format(strFormat)
-
-
- Date.prototype.unformat(strDate,strFormat)
-
-
- Date.prototype.getMDate();
-
-
- Date.prototype.getFirstDay();
-
-
- Date.prototype.getLastDay();
StringBuffer对象 -- 字符缓冲器
-
- StringBuffer.prototype.append(str);
-
-
- var strBuffer = new StringBuffer();
- strBuffer('hello ');
- strBuffer('world!');
-
- alert(strBuffer.toString());
|