码迷,mamicode.com
首页 > Web开发 > 详细

I should know the content of js

时间:2014-08-07 13:35:00      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:style   使用   os   io   ar   cti   new   window   

  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

标签:style   使用   os   io   ar   cti   new   window   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!