叶子asp分页类(9)
if (iPC>=1) {
PSelect="<Select class=\""+CPS+"\" name=\""+sPI+"\" onChange=\""+sN+".PageJump()\">";
PInput="<Input class=\""+CPI+"\" type=\"text\" name=\""+sPI+"\" size=\"5\" maxlength=\"10\" onkeydown=\"if (event.keyCode==13) "+sN+".PageJump()\">";
for (var i=PageStart;i<=PageEnd;i++) {
if (i!=iPI) {
p=s1+sU.replace(sTPage,i)+s2+PT_E.replace(sTPageNum,i)+s3;
PText+=PTF_E.replace(sTPTextF,p);
PSelect+="<Option value=\""+i+"\">"+PS_E.replace(sTPageNum,i)+"</Option>";
}
else {
p=s4+PT_D.replace(sTPageNum,i)+s5;
PText+=PTF_D.replace(sTPTextF,p);
PSelect+="<Option Selected=\"Selected\">"+PS_D.replace(sTPageNum,i)+"</Option>";
}
}
PSelect+="</Select>";
}
s=s.replace(sTPage,iPI);
s=s.replace(sTPageCount,iPC);
s=s.replace(sTRecCount,iRC);
s=s.replace(sTPageSize,iPS);
s=s.replace(sTPFrist,FU);
s=s.replace(sTPPrev,PU);
s=s.replace(sTPNext,NU);
s=s.replace(sTPLast,LU);
s=s.replace(sTPText,PText);
s=s.replace(sTPInput,PInput);
s=s.replace(sTPSelect,PSelect);
document.write (s);
}
//输入:欲格式化字符,是否有最小值(0表示没有,1表示有),是否有最大值,最小值(默认值),最大值
Cls_jsPage.prototype.FormatNum=function(sNum,bMin,bMax,iMinNum,iMaxNum){
var i,iN,sN=""+sNum,iMin=iMinNum,iMax=iMaxNum;
if (sN.length>0) {
iN=parseInt(sN,10);
i=(isNaN(iN))?iMin:iN;
i=(i<iMin&&bMin==1)?iMin:i;
i=(i>iMax&&bMax==1)?iMax:i;
}
else {
i=iMin;
}
return (i);
}
//输入:欲正则字符,正则表达式,替换后字符
Cls_jsPage.prototype.Reg=function(sStr,sReg,sRe){
var s="",sS=sStr,sR=sReg,sRe=sRe;
if ((sS.length>0)&&(sR.length>0)) {
eval("re=/"+sR+"/gim;");
s=sS.replace(re,sRe);
}
return (s);
}
//格式化正则中的特殊字符
Cls_jsPage.prototype.FormatReg=function(sReg){
var s="",sR=sReg;
var sF=new Array ("/",".","+","[","]","{","}","$","^","?","*");
if (sR.length>0) {
for (var i=0;i<=sF.length;i++) {
sR=sR.replace(sF[i],"\\"+sF[i]);
}
s="("+sR+")";
}
return (s);
}
demoAC.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
内容版权声明:除非注明,否则皆为本站原创文章。