Web前端开发-命名规则.doc
文本预览下载声明
Smart UI前台开发帮助
1、HTML命名规范
类型 命名对象 命名 代码Demo Input标签
类型简写+ P_+业务名(需求阶段已定义好)_+操作名(Add/Edit/Search等)+ 操作对象+ 命名 text/password txt input type=”text” id=”txtSuppListName” button btn input type=button id=”txtSuppListName” checkbox chk input type=checkbox id=”chkSuppListName” radio rdo input type=radio id=rdoSuppListIsStop/ hidden hid input type=hidden id=hidSuppListNo/ file fle input type=file id=fleSuppFile/ 常用 textarea txt textarea id=txtSuppEditNote /textarea select sel select id=”selSuppEditType”/select option op option id=”opSuppEditName1”/option a lnk a id=”lnkSuppListName”/a img img img id=”imgSuppListName” / label lbl lable id=”lblSuppViewName”/label font fnt font id=”fntSuppViewName”/font button btn button id=”btnSunnListSearch”/button 容器标签 (业务)命名(首字母小写) div div id=editSupp/div ul ul id=searchSupp/ul ol ol id=searchSupp/ol li li id=searchSupp/ li dd dd id=searchSupp/ dd dt dt id=searchSupp/ dt dl dl id=searchSupp/ dl table table id=searchSupp/ table th th id=searchSupp/ th tr tr id=searchSupp/ tr td td id=searchSupp/ td tbody dl id=searchSupp/ dl thead thead id=searchSupp/ thead tfoot tfoot id=searchSupp/ tfoot samp samp id=searchSupp/ samp span span id=searchSupp/ span p p id=searchSupp/ p 其他 hr hr / br br / 特殊命名 所有用于查询的标签, 类型简写后加’s’ 如:查询:txtsName,编辑:txtName 1.1.1、HTML编写要求
要求只能使用上述规定的标签
每个标签要求结构完整;
如:span/应写为: span/span
除hr、br、img、input外标签都应该是标签对完整的
br /hr/img /
除容器和文字标签外,不允许在标签中放置内容。
错误的写法:input type=checkbox库 存/input
正确的应该是:input type=checkbox value=库存 /input
关于对象的样式设置应该尽量使用系统定义的样式,除特殊的情况。
如:td style=text-align: right; font-size: 12px; width: 30px
1、JS命名规范
类型 命名对象 命名 代码Demo 基础数据类型 (类型简写+命名) string str var strSuppName int i var iSuppNo decmail d var dSuppNo array arr var arrSuppNames date dt var dSuppStopDateTime Json jsn var jsnPostdata 扩展 StringBulider sb var sbSuppName 特殊对象类型 object
显示全部