阻止事件传播,必须显示,return false;
return exp?confirm():!!alert();
js 定时器,线程,启动,开始,停止。参数传递,使用window;
js扩展:
String.prototype.Trim = String.prototype.trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, "");
};
function StringBuffer() {
this._strings_ = new Array();
}
StringBuffer.prototype.append = function(str) {
this._strings_.push(str);
return this;
};
StringBuffer.prototype.toString = function() {
return this._strings_.join("");
};
Date.prototype.toSimpleString = function() {
return (this.getFullYear() - 2000) + "/" + (this.getMonth() + 1) + "/" + this.getDate() + " " + this.getHours() + ":" + this.getMinutes();
};