11.报错并返回ifrs.bofandrs.eofthen‘还是有问题response.writeSCRIPTlanguage=JavaScriptalert('找不到!');response.writejavascript:history.go(-1)/SCRIPTendif-----------------------------------这个是跳转。scriptlanguage=javascriptalert('%=intOperationInfo%');window.navigate('ChangePwd.asp');/Script12.从VBS到JS,混用%dimcheckpwdconfigcheckpwdconfig=split(addation,/)%scriptlanguage=javascriptalert(%=checkpwdconfig(0)%)/script13.弹出窗口scriptlanguage=javascriptfunctionopenaddnew(){subWindow=window.open(../Edit/PasswordConfigEdit.asp?method=new,'','scrollbars=yes,left=120,top=60,height=250,width=500,menubar=no,location=no,toolbar=no,resizable=yes','')subWindow.opener=this;}/script用一个连接调用:ahref=#请修改密码onClick=openaddnew()/a图片调用:imgname=submit1src=../button_new%=session(languageid)%.gifonClick=openaddnew()14.分页!--#includefile=conn.asp--%ifrequest(pageno)thenpageno=int(request(pageno))elsepageno=1endifsql=select*fromnewswhere[language]='中文'andbigclassname='新闻'orderbyiddescSetrs=Server.CreateObject(ADODB.Recordset)rs.opensql,conn,1,3rs.pagesize=20ifrs.eofthenpageno=0elsers.absolutepage=pagenoendif%==========================================共%=rs.recordcount%条,%=pageno%/%=int(rs.pagecount)%页,每页%=rs.pagesize%条ahref=manage.asp?pageno=1首页/a%ifpageno1then%ahref=manage.asp?pageno=%=int(pageno)-1%上一页/a%endififint(pageno)int(rs.pagecount)then%ahref=manage.asp?pageno=%=int(pageno+1)%下一页/a%endif%ahref=manage.asp?pageno=%=int(rs.pagecount)%尾页/a%rs.close%%callCloseConn()%15.数据库更新sql=select*from[user]whereusername='&request(username)&'rs.Opensql,Conn,1,3rs(usermail)=Request(usermail)rs(userhome)=Request(userhome))rs.updaters.close16.关闭独立窗口headOBJECTid=closestype=application/x-oleobjectclassid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11paramname=Commandvalue=Close/object/headbodyinputtype=buttonvalue=点击我关闭窗口onclick=closes.Click();/body17.极细表格tableborder=1cellpadding=0cellspacing=0width=32height=32bordercolorlight=#000000bordercolordark=#FFFFFFtrtd/td/tr/table18.几个正则表达式Require:/.+/,Email:/^\w+([-+.]\w+)*@\w+([-.]\\w+)*\.\w+([-.]\w+)*$/,Phone:/^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/,Mobile:/^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/,Url:/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^\\])*$/,IdCard:/^\d{15}(\d{2}[A-Za-z0-9])?$/,Currency:/^\d+(\.\d+)?$/,Number:/^\d+$/,Zip:/^[1-9]\d{5}$/,QQ:/^[1-9]\d{4,8}$/,Integer:/^[-\+]?\d+$/,Double:/^[-\+]?\d+(\.\d+)?$/,English:/^[A-Za-z]+$/,Chinese:/^[\u0391-\uFFE5]+$/,UnSafe:/^(([A-Z]*|[a-z]*|\d*|[-_\~!@#\$%\^&\*\.\(\)\[\]\{\}\?\\\/\'\]*)|.{0,5})$|\s/,19.Left应用(控制字数)functiontitle(str)iflen(trim(str))=28thentitle=left(trim(str),27)&...elsetitle=trim(str)endifendfunction20.判断浏览器SCRIPTLANGUAGE=javascript1.2!--//if(navigator.appName=='Netscape')varlanguage=navigator.language;elsevarlanguage=navigator.browserLanguage;if(language.indexOf('en')-1)document.location.href='en/index.asp';elseif(language.indexOf('zh')-1)document.location.href='cn/index.asp';elsedocument.location.href='cn/index.asp';//End--/script21.嵌入另一页iframeclass=TBGenstyle=top:2pxID=UploadFilessrc=upload.aspframeborder=0scrolling=nowidth=250height=25/iframe-------------------------------------其实也可以用!--#includefile=fuck.asp--22.全部选定SCRIPTlanguage=javascriptfunctionCheckAll(form){for(vari=0;iform.elements.length;i++){vare=form.elements[i];if(e.Name!=chkAll)e.checked=form.chkAll.checked;}}/script引用:tdwidth=250height=30inputname=chkAlltype=checkboxid=chkAllonclick=CheckAll(this.form)value=checkbox选中本页显示的所有/td小格:inputname='username'type='checkbox'id=usernamevalue=%=cstr(rsView(username))%23.如何处理页面执行时发生的错误?%@LANGUAGE=VBScript%%Response.Buffer=True'打开页面缓冲OnErrorResumeNext'打开错误处理…………'ASP代码%%IfErr.Number0Then'错误处理Response.Clear'清除缓冲区%HTML'显示错误信息页面HEADTITLE页面错误报告/TITLE/HEADBODYBGCOLOR=#C0C0C0fontcolor=redp页面错误报告/p错误号:%=Err.Number%BR错误描述:%=Err.Description%BR错误源:Source%=Err.Source%BR错误发生行:%=Err.Line%BR/BODY/HTML%EndIf%24.收藏夹图标.在HEAD部分加入下面的内容:LINKREL=SHORTCUTICONHREF=在地址栏加入图标(图标必须是.ico格式,并且要加入收藏后才有效)在HEAD里加入linkrel=shortcuticonhref=favicon.ico25.校验提交表单(正则表达式应用)scriptlanguage=JavaScript!--functionCheckForm(){if(LoginID.value==){alert(请填写您的登录名!);LoginID.focus();returnfalse;}varfilter=/^\s*[.A-Za-z0-9_-]{5,15}\s*$/;if(!filter.test(LoginID.value)){alert(用户名填写不正确,请重新填写!可使用的字符为(A-Za-z0-9_-.)长度不小于5个字符,不超过15个字符,注意不要使用空格。);LoginID.focus();LoginID.select();returnfalse;}if(Password.value==){alert(请填写您的密码!);Password.focus();returnfalse;}varfilter=/^\s*[.A-Za-z0-9_-]{5,15}\s*$/;if(!filter.test(Password.value)){alert(密码填写不正确,请重新填写!可使用的字符为(A-Za-z0-9_-.)长度不小于5个字符,不超过15个字符,注意不要使用空格。);Password.focus();Password.select();returnfalse;}if(Password.value!=ConfirmPassword.value){alert(请两次填写的密码不一致,请重新填写!);ConfirmPassword.focus();returnfalse;}if(CompanyName.value==){alert(请填写贵公司名称!);CompanyName.focus();returnfalse;}varfilter=/^[a-zA-Z][a-zA-Z0-9._-