个人关于做网站ASP开发技巧,供参考
您正在看的网站运营方案是:个人关于做网站ASP开发技巧,供参考!。 个人关于做网站ASP开发技巧,供参考!)v3IO7ND1.几个常用函数
Round(pi, 2) 四舍五入 o5~qzaSGc4F{
FormatNumber(k,4) ' 把 k 格式化为带四位小数点的数。 (M0{*z k,M^
eg. 如果k =20000则显示为20,000.00;如果把formatnumber(k,0)则为20,000 W m5p5W#vm w9~D\,Nx(G
Replace(expression,find,replacewith) '返回一字符串,其中指定的子串已被另一个子串替换 %wiJ,?'F.uh
Left(String,Length) '返回指定数目的从字符串的左边算起的字符串。
Split(expression[, delimiter[, count[, start]]]) '返回基于 0 的一维数组,其中包含指定数目的子字符串。
eg. 常用这个 Split(String,[delimiter]) ' 用delimiter(用于标识子字符串界限的字符)来划分字符串 Qd#`@yi J
Instr(String1,String2) '返回某字符串在另一字符串中第一次出现的位置
eg1. if instr(addation,"密码配置表")<>0 then '说明存在
eg2. if instr(str,”AP”) >0 不好区分str = (AP,AP&AC),此时只要变为(’AP’,’AP&AC’),再用instr(str,”’AP’”)
2. 弹出窗口Pick值 .Lx'rsU]C
function pickupSP(spdisid,pjnum,pdcode)
{
window.opener.<%=theForm%>.RefNum<%=Spid%>.value=spdisid; N.{F~D
window.opener.<%=theForm%>.LineS<%=Spid%>.value=pjnum;
window.opener.<%=theForm%>.kokey<%=Spid%>.value=pdcode;
window.close(); 3P4l,lW7_)s
} 1r Rz~.}p])C&m
3. ASP控制图片显示的大小(等比例缩放)
<HTML> e*bT(KIc%AQW.q
<HEAD>
<TITLE> New Document </TITLE>
<script language="JavaScript"> f0n ~1z6}3b&Rz
<!-- 7E'dj} T @ |
var flag=false;
function DrawImage(ImgD){ 2q4q%@,G%h2d-EM
var image=new Image();
image.src=ImgD.src; ~n0z[D IU
if(image.width>0 && image.height>0){ 2z(vM0ZjY)m
flag=true; Gwy/o5}
if(image.width/image.height>= 164/112){
if(image.width>164){
ImgD.width=164; mzo"W&Lqto
ImgD.height=(image.height*164)/image.width;
}else{ "ZuLG_Y2_
ImgD.width=image.width;
ImgD.height=image.height; 6K5PB F O Z?p:V n
}
ImgD.alt=image.width+"x"+image.height; e-}d/RT1r ['K
} q\ u2UPr9R)cBCaz
else{
if(image.height>112){
ImgD.height=112; uu1p~Om$r3N
ImgD.width=(image.width*112)/image.height;
}else{
ImgD.width=image.width; 9\.u;j)M,_C
ImgD.height=image.height; jX7L)l6HT m(h mi
}
ImgD.alt=image.width+"x"+image.height; w U}u6whW
} 1B5C*D8J*c l,S
}
}
//--> %qf1~kQ
</script>
</HEAD>
<BODY>
