首页 > Web开发 > 详细

I should know the content of js

时间:2014-08-07 13:35:00      阅读:292      评论:0      收藏:0      [点我收藏+]
  1. 阻止事件传播,必须显示,return false;

  2. return exp?confirm():!!alert();

  3. js 定时器,线程,启动,开始,停止。参数传递,使用window;

  4. 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();

};


I should know the content of js,布布扣,bubuko.com

I should know the content of js

原文:http://my.oschina.net/jstech/blog/298744

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!