备忘一下自己的书写风格,并努力在以后书写时保持风格的一致性。
css:
/* 整体文件作用说明 */
@charset "utf-8";
/**
* XXX.inc (C) http://www.XXX.com.cn
* by: TRS bwl
* since: 2008-08-25 13:44
*/
* {font-family: "宋体";font-size:12px;padding:0px;margin:0px;}
/* 更多样式定义,将样式分为几类,并且每类之前增加说明 */
js:
/**
* 通用确认框架
*
* @author TRS bwl(***@gmail.com)
* @since 2008-08-25 13:46
*/
// ---------------------------------------------------------
if (typeof $ == "undefined") {
var $ = function(sid) {
if (typeof sid == "string") {
return document.getElementById(sid);
}
return sid;
};
}
//----------- 封装stringBuffer对象,可以节省字符串拼接的开销 -----------
function xStringBuffer() {
this._strings_ = new Array();
}
xStringBuffer.prototype.append = function (str) {
this._strings_.push(str);
};
xStringBuffer.prototype.toString = function () {
var str = this._strings_.join("");
delete this._strings_;
this._strings_ = new Array();
return str;
};
/* 更多实现。。。 */
本文档介绍了CSS和JavaScript的基本编码规范,包括了整体文件的作用说明、样式定义分类及说明、JavaScript封装函数等内容,旨在帮助开发者形成一致的编码风格。
1393

被折叠的 条评论
为什么被折叠?



