|
项目代码编写技巧
关于JavaScript
<!--[if !supportLists]-->1、 <!--[endif]-->使用JAVASCRIPT验证表单,必须同时使用JAVASCRIPT提交表单,而不是使用type=submit的按钮提交表单。这样用户在IE设置中禁止脚本之后,数据验证被屏蔽的同时,表单也无法提交。
<!--[if !supportLists]-->2、 <!--[endif]-->JavaScript变量和函数的命名要求同JAVA代码。局部变量必须使用VAR定义,避免使用全局变量。如:Var i,j;
<!--[if !supportLists]-->3、 <!--[endif]-->在编辑页面的保存、审核、反审核等javascript函数的开始处,一般需要下面代码,以防止页面按钮重复提交问题。
<!--[if gte vml 1]><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"> <v:stroke joinstyle="miter" /> <v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype><v:shape id="_x0000_s1027" type="#_x0000_t202" style='position:absolute; left:0;text-align:left;margin-left:0;margin-top:7.8pt;width:468pt;height:85.8pt; z-index:2' /><![endif]--><!--[if !vml]--><span style="">[table][tr][td=1,1,630]<!--[endif]--><!--[if !mso]--><span style=""> [table=98%][tr][td]<!--[endif]--><div class="shape" style="padding: 4.35pt 7.95pt 4.35pt 7.95pt;">document.edit.store.disabled = true;
document.edit.Submit.disabled = true;
或者
document.edit.Submit.disabled = false;
document.edit.store.disabled = false; |
|