|
HTML文件標(biāo)記 <html> <head> <!--> <title> <body>
文字排版標(biāo)記
HTML文件標(biāo)記 <html> <head> <!--> <title> <body>
文字排版標(biāo)記 <br/> <nobr> <p> <pre> 原始文字樣式 <center> <blockquote> 向內(nèi)縮排 <h> 標(biāo)題 <strong>,<b> 粗體 <em>,<i>,<cite> 斜體 <U> 底線 <strike> 刪除線 <blink> 文字閃爍 <big> 大型字體 <small> 小型字體 <sup> 文字上標(biāo) <SUB> 文字下標(biāo) <basefont> 默認(rèn)字體設(shè)置 <font> 更改字體設(shè)置
菜單標(biāo)記 <menu> 選項(xiàng)菜單 <dir> 目錄菜單 <lh> 菜單格式(一) <ul> 菜單格式(二) <dl>,<dt>,<dd> 說明式菜單 <ol>,<li> 標(biāo)題菜單
直線與表格標(biāo)記 <hr> <table> <tr> <td> <th> <caption> 表格標(biāo)題
超鏈接標(biāo)記 <a> 錨
圖形標(biāo)記 <IMG> 插入圖形
框架標(biāo)記 <FRAME> 定義框架內(nèi)容 <NOFRAME> 不支持框架聲明
表單標(biāo)記 <FORM> <INPUT> <TEXTAREA> <SELECT> <OPTION>
SCRIPT <script>
VBSCRIPT標(biāo)記索引
基本運(yùn)算 + 數(shù)字加法及字符串連接 - 數(shù)字減法 * 數(shù)字乘法 / 數(shù)字除法 Mod 求余數(shù) \ 求商數(shù) & 字符串連接 ^ 次方 = 相等 <> 不相等 >= 大于或等于 > 大于 <= 小于或等于 < 小于 Not 非 And 且 Or 或 Xor 異或
循環(huán)及決策 if ....then 若...則... if ...then...else 若...則...非 else if... 非若 select case... 群組選擇條件 end select for ... next 計(jì)數(shù)循環(huán) while...wend 條件循環(huán)(一) do while...loop 條件循環(huán)(二) do...loop while 條件循環(huán)(三) do until...loop 條件循環(huán)(四) do...loop until 條件循環(huán)(五)
數(shù)學(xué)函數(shù) Abs 絕對(duì)值 Sgn 正負(fù)號(hào) Hex 轉(zhuǎn)換成十六進(jìn)制 Oct 轉(zhuǎn)換成八進(jìn)制 Sqr 平方根 Int 取整數(shù) Fix 取整數(shù) Round 取整數(shù) Log 以e為底的對(duì)數(shù) Sin 正弦函數(shù) Cos 余弦函數(shù) Tan 正切函數(shù)
字符串處理函數(shù) Len 字符串長度 Mid 取部分字符串 Left 從字符串開頭取部分字符串 Right 從字符串結(jié)尾取部分字符串 Lcase 轉(zhuǎn)換成小寫 Ucase 轉(zhuǎn)換成大寫 Trim 清除字符串開頭及結(jié)尾的空格符 Ltrim 清除字符串開頭空格符 Rtrim 清除字符串結(jié)尾空格符 Replace 替換字符串部分字符 Instr 判斷是否包含于另一個(gè)字符串(從起始搜尋) InstrRev 判斷是否包含于另一個(gè)字符串(從結(jié)尾搜尋) Space 任意字符數(shù)的空格符 String 任意字符數(shù)的任一字符 StrReverse 反轉(zhuǎn)字符串 Split 以某字符分割字符串
數(shù)據(jù)類型轉(zhuǎn)換函數(shù) Cint 轉(zhuǎn)換成整形 Cstr 轉(zhuǎn)換成字符串 Clng 轉(zhuǎn)換成常整數(shù) Cbool 轉(zhuǎn)換成布爾函數(shù) Cdate 轉(zhuǎn)換成日期函數(shù) CSng 轉(zhuǎn)換成單精度 CDbl 轉(zhuǎn)換成雙精度
日期時(shí)間函數(shù) Date 現(xiàn)在日期 Time 現(xiàn)在時(shí)間 NOw 現(xiàn)在日期時(shí)間 DateAdd 增加日期 DateDiff 兩日期差 DateSerial 日期設(shè)定 DateValue 日期設(shè)定 Year 現(xiàn)在年份 Month 現(xiàn)在月份 Day 現(xiàn)在天 Hour 現(xiàn)在時(shí)刻 Minute 現(xiàn)在分鐘 Second 現(xiàn)在秒鐘 Timer 午夜距現(xiàn)在秒數(shù) TimeSerial 時(shí)間設(shè)定 TimeValue 時(shí)間所屬部分 WeekDay 星期名稱 MonthName 月份名稱
其它函數(shù) Array 產(chǎn)生數(shù)組 Asc 字符ASCII碼 Chr ASCII碼字符 Filter 過濾數(shù)組 InputBox 輸入窗口 Join 合并數(shù)組中的元素 MsgBox 信息窗口 Lbound 數(shù)組下界 Ubound 數(shù)組上界
指令 Const 設(shè)定常數(shù) Dim 定義變量或者數(shù)組 Erase 清除數(shù)組 ReDim 重新聲明數(shù)組 Randomize 起始隨機(jī)數(shù) Rnd 取得隨機(jī)數(shù)
ASP對(duì)象
Session對(duì)象 IsEmpty 測試Session變量是否存在 TimeOut 設(shè)定Session變量生存周期 Abandon 強(qiáng)制清除Session變量
Application對(duì)象 IsEmpty 測試Application變量是否存在 Lock 鎖定Application變量 Unlock 解除Lock指令的鎖定
Cookies對(duì)象 Expires 設(shè)定Cookies變量的生存周期
Connection對(duì)象 Open 打開與數(shù)據(jù)庫的連接 Execute 打開Recordset對(duì)象 Close 關(guān)閉Connection對(duì)象
Recordset對(duì)象 movefirst 將記錄指針移至第一條 movelast 將記錄指針移至最后一條 movenext 將記錄指針移至下一條 moveprevious 將記錄指針移至上一條 bof 測試是否為recordset的起始 eof 測試是否為recordset的結(jié)束 open 打開Recoreset對(duì)象 close 關(guān)閉recordset對(duì)象 fields 讀取數(shù)據(jù)的子對(duì)象 fileds.count 字段個(gè)數(shù) pagesize 每頁記錄條數(shù) absolutepage 設(shè)定為某頁 pagecount 總頁數(shù) Absoluteposition 直接跳至某條記錄
沒什么好共享的,但太感動(dòng)了,把做樹型菜單的js函數(shù)貼出來, <SCRIPT language="JavaScript"> var lastObj
function expandIt(obj) { if(lastObj != null) { if(obj == lastObj) { if(obj.style.display == "none") { obj.style.display = ""; } else { obj.style.display = "none" } } else { lastObj.style.display = "none"; obj.style.display = ""; } } else { obj.style.display = ""; }
lastObj = obj } </SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <% dim id id = request("id") dim strsql,rs
strsql="select * from p_type where slanguage=1 and typelevel=1 order by typename" set rs=fgetrslist(strsql) do while not rs.eof
%> <tr> <td height="25" class="LEFTLINKS"><img width="30" height="0" align="absmiddle" /><b><%if rs("isleaf")=0 then%><a href="#" onClick="javascript:expandIt(kb<%=rs("id")%>);return false"><%else%><a href="<%=request.ServerVariables("SCRIPT_NAME")%>?idtree=<%=rs("idtree")%>" ><%end if%><%=server.HTMLEncode(right((rs("typename")&""),len(rs("typename")&"")-2))%></a></b></td> </tr> <% IF clng(id)=clng(rs("id")) then
%> <tr id="kb<%=rs("id")%>"> <% else
%>
<tr id="kb<%=rs("id")%>" style="display:none;"> <% end if %> <td> <table> <% dim rs1 strsql="select * from p_type where parentid="&rs("id")&" and slanguage=1 order by typename" set rs1=fgetrslist(strsql) do while not rs1.eof %> <tr><td height="20" class="LEFTLINKS"> <img width="40" height="0" align="absmiddle" /><a href="<%=request.ServerVariables("SCRIPT_NAME")%>?idtree=<%=rs1("idtree")%>&id=<%=rs("id")%>" ><%=server.HTMLEncode(right((rs1("typename")&""),len(rs1("typename")&"")-2))%></a></td></tr> <% rs1.movenext loop rs1.close set rs1=nothing %> </table> </td> </tr> <% rs.movenext
loop rs.close set rs=nothing %> </table>
計(jì)算網(wǎng)頁文本的漢字字?jǐn)?shù),去掉了表格以外的所有標(biāo)識(shí)。 Function GetLength(strChinese1) Dim strWord, ascWord, lenTotal strChinese1 = Trim(strChinese1)
If strChinese1 = "" Or Vartype(strChinese1) = vbNull Then GetLength = 0 Exit Function End If
lenTotal = 0 For GetLengthi=1 to Len(strChinese1) strWord = Mid(strChinese1, GetLengthi, 1) ascWord = Asc(strWord) If ascWord < 0 or ascWord > 127 then lenTotal = lenTotal + 1 Elseif ascWord = 63 And strWord <> "?" then lenTotal = lenTotal + 1 Elseif ascWord = 44 And strWord <> "," then lenTotal = lenTotal + 1 Elseif ascWord = 33 And strWord <> "!" then lenTotal = lenTotal + 1 Else lenTotal = lenTotal End If Next
GetLength = lenTotal End Function
昨天有人問MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤的全部列表,我給他回了vbscript幫助里面的錯(cuò)誤列表,回來自己用Err.Raise做了個(gè)編歷的小程序,發(fā)現(xiàn)給人家發(fā)的不全,再想貼卻發(fā)現(xiàn)有限制,連續(xù)不能發(fā)三貼以上。。郁悶
MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(完整版)共121個(gè)
MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0005) 無效的過程調(diào)用或參數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0005) 無效的過程調(diào)用或參數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0006) 溢出 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0007) 內(nèi)存不夠 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0009) 下標(biāo)越界 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A000A) 該數(shù)組為定長的或臨時(shí)被鎖定 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A000B) 被零除 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A000D) 類型不匹配 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A000E) 字符串空間不夠 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0011) 不能執(zhí)行所需的操作 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A001C) 堆棧溢出 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0023) 未定義過程或函數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0030) 加載 DLL 時(shí)出錯(cuò) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0033) 內(nèi)部錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0034) 錯(cuò)誤的文件名或號(hào)碼 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0035) 文件未找到 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0036) 錯(cuò)誤的文件模式 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0037) 文件已經(jīng)打開 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0039) 設(shè)備 I/O 錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A003A) 文件已存在 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A003D) 磁盤已滿 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A003E) 輸入超出了文件尾 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0043) 文件過多 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0044) 設(shè)備不可用 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0046) 沒有權(quán)限 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0047) 磁盤沒有準(zhǔn)備好 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A004A) 重命名時(shí)不能帶有其他驅(qū)動(dòng)器符號(hào) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A004B) 路徑/文件訪問錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A004C) 路徑未找到 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A005B) 對(duì)象變量未設(shè)置 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A005C) For 循環(huán)未初始化 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A005E) 無效使用 Null MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0142) 不能創(chuàng)建必要的臨時(shí)文件 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01A8) 缺少對(duì)象 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01AD) ActiveX 部件不能創(chuàng)建對(duì)象 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01AE) 類不支持 Automation 操作 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01B0) Automation 操作中文件名或類名未找到 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01B6) 對(duì)象不支持此屬性或方法 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01B8) Automation 操作錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01BD) 對(duì)象不支持此操作 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01BE) 對(duì)象不支持已命名參數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01BF) 對(duì)象不支持當(dāng)前區(qū)域設(shè)置選項(xiàng) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C0) 未找到已命名參數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C1) 參數(shù)是必選項(xiàng) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C2) 錯(cuò)誤的參數(shù)個(gè)數(shù)或無效的參數(shù)屬性值 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C3) 對(duì)象不是一個(gè)集合 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C5) 未找到指定的 DLL 函數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C7) 代碼資源鎖定錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01C9) 此鍵已與該集合的一個(gè)元素關(guān)聯(lián) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01CA) 變量使用了一個(gè) VBScript 中不支持的 Automation 類型 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01CE) 遠(yuǎn)程服務(wù)器不存在或不可用 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01E1) 無效圖片 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01F4) 變量未定義 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01F5) 非法賦值 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01F6) 對(duì)象不能安全用 Script 編程 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01F7) 對(duì)象不能安全初始化 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01F8) 對(duì)象不能安全創(chuàng)建 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01F9) 無效的或無資格的引用 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01FA) 類沒有被定義 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A01FB) 出現(xiàn)一個(gè)意外錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03E9) 內(nèi)存不夠 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03EA) 語法錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03EB) 缺少 ‘:‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03ED) 缺少 ‘(‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03EE) 缺少 ‘)‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03EF) 缺少 ‘]‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F2) 缺少標(biāo)識(shí)符 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F3) 缺少 ‘=‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F4) 缺少 ‘If‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F5) 缺少 ‘To‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F6) 缺少 ‘End‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F7) 缺少 ‘Function‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F8) 缺少 ‘Sub‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03F9) 缺少 ‘Then‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03FA) 缺少 ‘Wend‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03FB) 缺少 ‘Loop‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03FC) 缺少 ‘Next‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03FD) 缺少 ‘Case‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03FE) 缺少 ‘Select‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A03FF) 缺少表達(dá)式 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0400) 缺少語句 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0401) 語句未結(jié)束 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0402) 缺少整型常數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0403) 缺少 ‘While‘ 或 ‘Until‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0404) 缺少 ‘While‘ 和 ‘Until‘或語句未結(jié)束 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0405) 缺少 ‘With‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0406) 標(biāo)識(shí)符過長 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0407) 無效數(shù)字 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0408) 無效字符 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0409) 未結(jié)束的字符串常量 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A040A) 注釋未結(jié)束 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A040D) 無效使用 ‘Me‘ 關(guān)鍵字 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A040E) ‘loop‘ 語句缺少 ‘do‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A040F) 無效的 ‘exit‘ 語句 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0410) 循環(huán)控制變量 ‘for‘ 無效 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0411) 名稱重定義 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0412) 必須是行中的第一個(gè)語句 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0413) 不能為 non-ByVal 參數(shù)賦值 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0414) 調(diào)用子程序時(shí)不能使用括號(hào) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0415) 缺少文字常數(shù) MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0416) 缺少 ‘In‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0417) 缺少 ‘Class‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0418) 必須在一個(gè)類的內(nèi)部定義 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0419) 在屬性聲明中缺少 Let , Set 或 Get MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A041A) 缺少 ‘Property‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A041B) 在所有屬性的規(guī)范中,變量的數(shù)目必須一致 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A041C) 在一個(gè)類中不允許有多個(gè)缺省的屬性/方法 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A041D) 類的初始化或終止程序沒有變量 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A041E) 屬性的 set 或 let 必須至少有一個(gè)變量 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A041F) 錯(cuò)誤的 ‘Next‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0420) ‘Default‘ 只能在 ‘Property‘ , ‘Function‘ 或 ‘Sub‘ 中指定 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0421) 指定 ‘Default‘ 時(shí)必須同時(shí)指定 ‘Public‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A0422) 只能在 Property Get 中指定 ‘Default‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A1000) Microsoft VBScript 編譯器錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A1001) Microsoft VBScript 運(yùn)行時(shí)錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A1398) 缺少正則表達(dá)式對(duì)象 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A1399) 正則表達(dá)式語法錯(cuò)誤 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A139A) 錯(cuò)誤的數(shù)量詞 MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A139B) 正則表達(dá)式中缺少 ‘]‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A139C) 正則表達(dá)式中缺少 ‘)‘ MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤(0x000A139D) 字符集越界
10進(jìn)制表示,希望actor2222 (優(yōu)悠) 能看到
MicrosoftVBscript運(yùn)行時(shí)錯(cuò)誤列表(10進(jìn)制表示)
error # 5 無效的過程調(diào)用或參數(shù) error # 5 無效的過程調(diào)用或參數(shù) error # 6 溢出 error # 7 內(nèi)存不夠 error # 9 下標(biāo)越界 error # 10 該數(shù)組為定長的或臨時(shí)被鎖定 error # 11 被零除 error # 13 類型不匹配 error # 14 字符串空間不夠 error # 17 不能執(zhí)行所需的操作 error # 28 堆棧溢出 error # 35 未定義過程或函數(shù) error # 48 加載 DLL 時(shí)出錯(cuò) error # 51 內(nèi)部錯(cuò)誤 error # 52 錯(cuò)誤的文件名或號(hào)碼 error # 53 文件未找到 error # 54 錯(cuò)誤的文件模式 error # 55 文件已經(jīng)打開 error # 57 設(shè)備 I/O 錯(cuò)誤 error # 58 文件已存在 error # 61 磁盤已滿 error # 62 輸入超出了文件尾 error # 67 文件過多 error # 68 設(shè)備不可用 error # 70 沒有權(quán)限 error # 71 磁盤沒有準(zhǔn)備好 error # 74 重命名時(shí)不能帶有其他驅(qū)動(dòng)器符號(hào) error # 75 路徑/文件訪問錯(cuò)誤 error # 76 路徑未找到 error # 91 對(duì)象變量未設(shè)置 error # 92 For 循環(huán)未初始化 error # 94 無效使用 Null error # 322 不能創(chuàng)建必要的臨時(shí)文件 error # 424 缺少對(duì)象 error # 429 ActiveX 部件不能創(chuàng)建對(duì)象 error # 430 類不支持 Automation 操作 error # 432 Automation 操作中文件名或類名未找到 error # 438 對(duì)象不支持此屬性或方法 error # 440 Automation 操作錯(cuò)誤 error # 445 對(duì)象不支持此操作 error # 446 對(duì)象不支持已命名參數(shù) error # 447 對(duì)象不支持當(dāng)前區(qū)域設(shè)置選項(xiàng) error # 448 未找到已命名參數(shù) error # 449 參數(shù)是必選項(xiàng) error # 450 錯(cuò)誤的參數(shù)個(gè)數(shù)或無效的參數(shù)屬性值 error # 451 對(duì)象不是一個(gè)集合 error # 453 未找到指定的 DLL 函數(shù) error # 455 代碼資源鎖定錯(cuò)誤 error # 457 此鍵已與該集合的一個(gè)元素關(guān)聯(lián) error # 458 變量使用了一個(gè) VBScript 中不支持的 Automation 類型 error # 462 遠(yuǎn)程服務(wù)器不存在或不可用 error # 481 無效圖片 error # 500 變量未定義 error # 501 非法賦值 error # 502 對(duì)象不能安全用 Script 編程 error # 503 對(duì)象不能安全初始化 error # 504 對(duì)象不能安全創(chuàng)建 error # 505 無效的或無資格的引用 error # 506 類沒有被定義 error # 507 出現(xiàn)一個(gè)意外錯(cuò)誤 error # 1001 內(nèi)存不夠 error # 1002 語法錯(cuò)誤 error # 1003 缺少 ‘:‘ error # 1005 缺少 ‘(‘ error # 1006 缺少 ‘)‘ error # 1007 缺少 ‘]‘ error # 1010 缺少標(biāo)識(shí)符 error # 1011 缺少 ‘=‘ error # 1012 缺少 ‘If‘ error # 1013 缺少 ‘To‘ error # 1014 缺少 ‘End‘ error # 1015 缺少 ‘Function‘ error # 1016 缺少 ‘Sub‘ error # 1017 缺少 ‘Then‘ error # 1018 缺少 ‘Wend‘ error # 1019 缺少 ‘Loop‘ error # 1020 缺少 ‘Next‘ error # 1021 缺少 ‘Case‘ error # 1022 缺少 ‘Select‘ error # 1023 缺少表達(dá)式 error # 1024 缺少語句 error # 1025 語句未結(jié)束 error # 1026 缺少整型常數(shù) error # 1027 缺少 ‘While‘ 或 ‘Until‘ error # 1028 缺少 ‘While‘ 和 ‘Until‘或語句未結(jié)束 error # 1029 缺少 ‘With‘ error # 1030 標(biāo)識(shí)符過長 error # 1031 無效數(shù)字 error # 1032 無效字符 error # 1033 未結(jié)束的字符串常量 error # 1034 注釋未結(jié)束 error # 1037 無效使用 ‘Me‘ 關(guān)鍵字 error # 1038 ‘loop‘ 語句缺少 ‘do‘ error # 1039 無效的 ‘exit‘ 語句 error # 1040 循環(huán)控制變量 ‘for‘ 無效 error # 1041 名稱重定義 error # 1042 必須是行中的第一個(gè)語句 error # 1043 不能為 non-ByVal 參數(shù)賦值 error # 1044 調(diào)用子程序時(shí)不能使用括號(hào) error # 1045 缺少文字常數(shù) error # 1046 缺少 ‘In‘ error # 1047 缺少 ‘Class‘ error # 1048 必須在一個(gè)類的內(nèi)部定義 error # 1049 在屬性聲明中缺少 Let , Set 或 Get error # 1050 缺少 ‘Property‘ error # 1051 在所有屬性的規(guī)范中,變量的數(shù)目必須一致 error # 1052 在一個(gè)類中不允許有多個(gè)缺省的屬性/方法 error # 1053 類的初始化或終止程序沒有變量 error # 1054 屬性的 set 或 let 必須至少有一個(gè)變量 error # 1055 錯(cuò)誤的 ‘Next‘ error # 1056 ‘Default‘ 只能在 ‘Property‘ , ‘Function‘ 或 ‘Sub‘ 中指定 error # 1057 指定 ‘Default‘ 時(shí)必須同時(shí)指定 ‘Public‘ error # 1058 只能在 Property Get 中指定 ‘Default‘ error # 4096 Microsoft VBScript 編譯器錯(cuò)誤 error # 4097 Microsoft VBScript 運(yùn)行時(shí)錯(cuò)誤 error # 5016 缺少正則表達(dá)式對(duì)象 error # 5017 正則表達(dá)式語法錯(cuò)誤 error # 5018 錯(cuò)誤的數(shù)量詞 error # 5019 正則表達(dá)式中缺少 ‘]‘ error # 5020 正則表達(dá)式中缺少 ‘)‘ error # 5021 字符集越界
利用ASP獲得圖象的實(shí)際尺寸的示例 <!--#include virtual="/learn/test/lib_graphicdetect.asp"--> <html><head> <TITLE>dbtable.asp</TITLE> </head> <body bgcolor="#FFFFFF"> <% graphic="images/learnaspiconmain.gif" HW = ReadImg(graphic) Response.Write graphic & " Dimensions: " & HW(0) & "x" & HW(1) & "<br/>" response.write "<img src=""/" & graphic & """" response.write height=""" & HW(0) & """ response.write width=""" & HW(0) & "">" %> </body></html>
The library that is included is:
<% Dim HW
Function AscAt(s, n) AscAt = Asc(Mid(s, n, 1)) End Function
Function HexAt(s, n) HexAt = Hex(AscAt(s, n)) End Function
Function isJPG(fichero) If inStr(uCase(fichero), ".JPG") <> 0 Then isJPG = true Else isJPG = false End If End Function
Function isPNG(fichero) If inStr(uCase(fichero), ".PNG") <> 0 Then isPNG = true Else isPNG = false End If End Function
Function isGIF(fichero) If inStr(uCase(fichero), ".GIF") <> 0 Then isGIF = true Else isGIF = false End If End Function
Function isBMP(fichero) If inStr(uCase(fichero), ".BMP") <> 0 Then isBMP = true Else isBMP = false End If End Function
Function isWMF(fichero) If inStr(uCase(fichero), ".WMF") <> 0 Then isWMF = true Else isWMF = false End If End Function
Function isWebImg(f) If isGIF(f) Or isJPG(f) Or isPNG(f) Or isBMP(f) Or isWMF(f) Then isWebImg = true Else isWebImg = true End If End Function
Function ReadImg(fichero) If isGIF(fichero) Then ReadImg = ReadGIF(fichero) Else If isJPG(fichero) Then ReadImg = ReadJPG(fichero) Else If isPNG(fichero) Then ReadImg = ReadPNG(fichero) Else If isBMP(fichero) Then ReadImg = ReadPNG(fichero) Else If isWMF(fichero) Then ReadImg = ReadWMF(fichero) Else ReadImg = Array(0,0) End If End If End If End If End If End Function
Function ReadJPG(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(167), 4) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,1) & HexAt(s,2)) ts.Close ReadJPG = HW End Function
Function ReadPNG(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(24), 8) HW(0) = HexToDec(HexAt(s,3) & HexAt(s,4)) HW(1) = HexToDec(HexAt(s,7) & HexAt(s,8)) ts.Close ReadPNG = HW End Function
Function ReadGIF(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(10), 4) HW(0) = HexToDec(HexAt(s,2) & HexAt(s,1)) HW(1) = HexToDec(HexAt(s,4) & HexAt(s,3)) ts.Close ReadGIF = HW End Function
Function ReadWMF(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(14), 4) HW(0) = HexToDec(HexAt(s,2) & HexAt(s,1)) HW(1) = HexToDec(HexAt(s,4) & HexAt(s,3)) ts.Close ReadWMF = HW End Function
Function ReadBMP(fichero) Dim fso, ts, s, HW, nbytes HW = Array("","") Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(Server.MapPath("/" & fichero), 1) s = Right(ts.Read(24), 8) HW(0) = HexToDec(HexAt(s,4) & HexAt(s,3)) HW(1) = HexToDec(HexAt(s,8) & HexAt(s,7)) ts.Close ReadBMP = HW End Function
Function isDigit(c) If inStr("0123456789", c) <> 0 Then isDigit = true Else isDigit = false End If End Function
Function isHex(c) If inStr("0123456789ABCDEFabcdef", c) <> 0 Then isHex = true Else ishex = false End If End Function
Function HexToDec(cadhex) Dim n, i, ch, decimal decimal = 0 n = Len(cadhex) For i=1 To n ch = Mid(cadhex, i, 1) If isHex(ch) Then decimal = decimal * 16 If isDigit(c) Then decimal = decimal + ch Else decimal = decimal + Asc(uCase(ch)) - Asc("A") End If Else HexToDec = -1 End If Next HexToDec = decimal End Function %>
常用的javascript function file://========================================= // 輸入數(shù)據(jù)檢驗(yàn) // 檢驗(yàn)空值 function funCheckEmpty(m_Text) { var strTmp=m_Text if (strTmp == null || strTmp == "") { return false } return true }
file://檢驗(yàn)內(nèi)容的長度 function funTextLenCheck(m_Text) { var strText=m_Text for(i=0;i<=strText.length-1;i++){ if (strText.charCodeAt(i)>=256){ return strText.length * 2 } } return strText.length }
file://檢驗(yàn)長度 function funCheckLen(m_Len,m_Text) { if (funTextLenCheck(m_Text)> m_Len) { return false } return true }
file://檢驗(yàn)是否為數(shù)字 function funCheckNumber(m_Text) { var strTmp=m_Text if (isNaN(strTmp)) { return false } return true }
file://檢驗(yàn)日期是否合法 function funcheckDate(m_Year,m_Month,m_Day){ file://根據(jù)月先取得最大日期 var maxDay if (m_Month==2) { maxDay=28 if (m_Year % 4 ==0) { maxDay=29 } } else { if (m_Month<=7){ if (m_Month % 2 ==0){ maxDay=30 }else{ maxDay=31 } }else{ if (m_Month % 2 ==0){ maxDay=31 }else{ maxDay=30 } } } if (m_Day>maxDay){ return false } return true }
file://讀取Cookies信息 function GetCookie(strCookName){ var arvCookies=document.cookie.split("; ") for(var i=0;i< arvCookies.length; i++) { var arvOneCookie=arvCookies[i].split("=") if (strCookName==arvOneCookie[0]){ return unescape(arvOneCookie[1]) } } return "" }
file://替換字符串中的非法字符 function Replace_Text(text){ var strTmp=text strTmp=strTmp.replace("@", "@") strTmp=strTmp.replace("?", "?") strTmp=strTmp.replace("&", "&") strTmp=strTmp.replace("‘", "‘") strTmp=strTmp.replace("<", "〈") strTmp=strTmp.replace(">", "〉") return strTmp
}
function Check_PassWord(text){ var strTmp=text if (strTmp.indexOf("‘")>-1){ return "‘" } if (strTmp.indexOf("?")>-1){ return "?" } if (strTmp.indexOf("&")>-1){ return "&" } if (strTmp.indexOf("<")>-1){ return "<" } if (strTmp.indexOf(">")>-1){ return ">" } return ""
}
function Check_Url(text){ var strTmp=text if (strTmp.indexOf("‘")>-1){ return false } return true }
file://焦點(diǎn)控制 function document.onkeydown(){ var e = event.srcElement; if (event.keyCode == 13 && e.tagName == "INPUT" && e.type == "text"){ event.keyCode = 9; }
}
<% response.write " 1.oncontextmenu="window.event.returnvalue=false"將徹底屏蔽鼠標(biāo)右鍵 <tableborderoncontextmenu=return(false)><td>no</table>可用于table 2.<bodyonselectstart="returnfalse">取消選取、防止復(fù)制 3.onpaste="returnfalse"不準(zhǔn)粘貼 4.oncopy="returnfalse;"oncut="returnfalse;"防止復(fù)制 5.<linkrel="shortcuticon"href="favicon.ico">ie地址欄前換成自己的圖標(biāo) 6.<linkrel="bookmark"href="favicon.ico">可以在收藏夾中顯示出你的圖標(biāo) 7.<inputstyle="ime-mode:disabled">關(guān)閉輸入法 8.永遠(yuǎn)都會(huì)帶著框架 <scriptlanguage="javascript"><!-- if(window==top)top.location.href="frames.htm";//frames.htm為框架網(wǎng)頁 file://--></script> 9.防止被人frame <scriptlanguage=javascript><!-- if(top.location!=self.location)top.location=self.location; file://--></script> 10.<noscript><iframesrc=*.html></iframe></noscript>網(wǎng)頁將不能被另存為 11.<inputtype=buttonvalue=查看網(wǎng)頁源代碼 onclick="window.location=view-source:+<img src="pic/url.gif" align=absmiddle border=0> http://www.csdn.net/";;;;> 12.怎樣通過asp的手段來檢查來訪者是否用了代理 <%ifrequest.servervariables("http_x_forwarded_for")<>""then response.write"<fontcolor=#ff0000>您通過了代理服務(wù)器,"&_ "真實(shí)的ip為"&request.servervariables("http_x_forwarded_for") endif "%> <% response.write" 13.取得控件的絕對(duì)位置 file://javascript <scriptlanguage="javascript"> functiongetie(e){ vart=e.offsettop; varl=e.offsetleft; while(e=e.offsetparent){ t+=e.offsettop; l+=e.offsetleft; } alert("top="+t+"\nleft="+l); } </script> file://vbscript <scriptlanguage="vbscript"><!-- functiongetie() dimt,l,a,b seta=document.all.img1 t=document.all.img1.offsettop l=document.all.img1.offsetleft whilea.tagname<>"body" seta=a.offsetparent t=t+a.offsettop l=l+a.offsetleft wend msgbox"top="&t&chr(13)&"left="&l,64,"得到控件的位置" endfunction --></script> 14.光標(biāo)是停在文本框文字的最后 <scriptlanguage="javascript"> functioncc() { vare=event.srcelement; varr=e.createtextrange(); r.movestart(character,e.value.length); r.collapse(true); r.select(); } </script> <inputtype=textname=text1value="123"onfocus="cc()"> 15.判斷上一頁的來源 asp: request.servervariables("http_referer") java script: document.referrer 16.最小化、最大化、關(guān)閉窗口 <objectid=hh1classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <paramname="command"value="minimize"></object> <objectid=hh2classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <paramname="command"value="maximize"></object> <objectid=hh3classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <paramname="command"value="close"></object> <inputtype=buttonvalue=最小化onclick=hh1.click()> <inputtype=buttonvalue=最大化onclick=hh2.click()> <inputtype=buttonvalue=關(guān)閉onclick=hh3.click()> 本例適用于ie 17. <% 定義數(shù)據(jù)庫連接的一些常量 constadopenforwardonly=0游標(biāo)只向前瀏覽記錄,不支持分頁、recordset、bookmark constadopenkeyset=1鍵集游標(biāo),其他用戶對(duì)記錄說做的修改將反映到記錄集中,但其他用戶增加或刪除記錄不會(huì)反映到記錄集中。支持分頁、recordset、bookmark constadopendynamic=2動(dòng)態(tài)游標(biāo)功能最強(qiáng),但耗資源也最多。用戶對(duì)記錄說做的修改,增加或刪除記錄都將反映到記錄集中。支持全功能瀏覽(access不支持)。 constadopenstatic=3靜態(tài)游標(biāo),只是數(shù)據(jù)的一個(gè)快照,用戶對(duì)記錄說做的修改,增加或刪除記錄都不會(huì)反映到記錄集中。支持向前或向后移動(dòng) constadlockreadonly=1鎖定類型,默認(rèn)的,只讀,不能作任何修改 constadlockpessimistic=2當(dāng)編輯時(shí)立即鎖定記錄,最安全的方式 constadlockoptimistic=3只有在調(diào)用update方法時(shí)才鎖定記錄集,而在此前的其他操作仍可對(duì)當(dāng)前記錄進(jìn)行更改、插入和刪除等 constadlockbatchoptimistic=4當(dāng)編輯時(shí)記錄不會(huì)被鎖定,而更改、插入和刪除是在批處理方式下完成的 constadcmdtext=&h0001 constadcmdtable=&h0002 " %> 18.網(wǎng)頁不會(huì)被緩存 htm網(wǎng)頁 <metahttp-equiv="pragma"content="no-cache"> <metahttp-equiv="cache-control"content="no-cache,must-revalidate"> <metahttp-equiv="expires"content="wed,26feb199708:21:57gmt"> 或者<metahttp-equiv="expires"content="0"> asp網(wǎng)頁 response.expires=-1 response.expiresabsolute=now()-1 response.cachecontrol="no-cache" php網(wǎng)頁 header("expires:mon,26jul199705:00:00gmt"); header("cache-control:no-cache,must-revalidate"); header("pragma:no-cache");
19.檢查一段字符串是否全由數(shù)字組成 <scriptlanguage="javascript"><!-- functionchecknum(str){returnstr.match(/\d/)==null} alert(checknum("1232142141")) alert(checknum("123214214a1")) file://--></script> 20.獲得一個(gè)窗口的大小 document.body.clientwidth,document.body.clientheight
21.怎么判斷是否是字符 if(/[^\x00-\xff]/g.test(s))alert("含有漢字"); elsealert("全是字符"); 22.textarea自適應(yīng)文字行數(shù)的多少 <textarearows=1 name=s1 cols=27 onpropertychange="this.style.posheight=this.scrollheight"> </textarea> 23.日期減去天數(shù)等于第二個(gè)日期 <scriptlanguage=javascript> functioncc(dd,dadd) { file://可以加上錯(cuò)誤處理 vara=newdate(dd) a=a.valueof() a=a-dadd*24*60*60*1000 a=newdate(a) alert(a.getfullyear()+"年"+(a.getmonth()+1)+"月"+a.getdate()+"日") } cc("12/23/2002",2) </script> 24.選擇了哪一個(gè)radio <html><scriptlanguage="vbscript"> functioncheckme() foreachobinradio1 ifob.checkedthenwindow.alertob.value next endfunction </script><body> <input name="radio1" type="radio" value="style" checked>style <input name="radio1" type="radio" value="barcode">barcode <input type="button" value="check"onclick="checkme()"> </body></html> 25.獲得本頁url的request.servervariables("")集合 response.write"<tableborder=1><!--tableheader--><tr><td><b>variables</b></td><td><b>value</b></td></tr>" foreachobinrequest.servervariables response.write"<tr><td>"&ob&"</td><td>"&request.servervariables(ob)&"</td></tr>" next response.write"</table>" 26. 本機(jī)ip<%=request.servervariables("remote_addr")%> 服務(wù)器名<%=request.servervariables("server_name")%> 服務(wù)器ip<%=request.servervariables("local_addr")%> 服務(wù)器端口<%=request.servervariables("server_port")%> 服務(wù)器時(shí)間<%=now%> iis版本<%=request.servervariables"server_software")%> 腳本超時(shí)時(shí)間<%=server.scripttimeout%> 本文件路徑<%=server.mappath(request.servervariables("script_name"))%> 服務(wù)器cpu數(shù)量<%=request.servervariables("number_of_processors")%> 服務(wù)器解譯引擎<%=scriptengine&"/" & scriptenginemajorversion &"." & scriptengineminorversion & "." & scriptenginebuildversion%> 服務(wù)器操作系統(tǒng)<%=request.servervariables("os")%> 27.enter鍵可以讓光標(biāo)移到下一個(gè)輸入框 <input onkeydown="if(event.keycode==13)event.keycode=9"> 28.檢測某個(gè)網(wǎng)站的鏈接速度: 把如下代碼加入<body>區(qū)域中: <scriptlanguage=javascript> tim=1 setinterval("tim++",100) b=1 varautourl=newarray() autourl[1]="< src="pic/url.gif" align=absmiddle border=0> www." autourl[2]="javacool.3322.net" autourl[3]="< src="pic/url.gif" align=absmiddle border=0> ")}/">http://";;;;;+autourl+")>")} run()</script>
29.各種樣式的光標(biāo) auto:標(biāo)準(zhǔn)光標(biāo) default:標(biāo)準(zhǔn)箭頭 hand:手形光標(biāo) wait:等待光標(biāo) text:i形光標(biāo) vertical-text:水平i形光標(biāo) no-drop:不可拖動(dòng)光標(biāo) not-allowed:無效光標(biāo) help:?幫助光標(biāo) all-scroll:三角方向標(biāo) move:移動(dòng)標(biāo) crosshair:十字標(biāo) e-resize n-resize nw-resize w-resize s-resize se-resize sw-resize 1.本地?zé)o緩存,每次自動(dòng)刷新 response.expires=0 response.addheader"pragma","no-cache" response.addheader"cache-control","private" 2.修改contenttype并下載gif等格式 <% functiondl(f,n) onerrorresumenext sets=createobject("adodb.stream") s.mode=3 s.type=1 s.open s.loadfromfile(server.mappath(f)) iferr.number>0then response.writeerr.number&":"&err.description else response.contenttype="application/x-gzip" response.addheader"content-disposition:","attachment;filename="&n response.binarywrite(s.read(s.size)) endif endfunction calldl("012922501.gif","t1.gif") %>
19.檢查一段字符串是否全由數(shù)字組成 <scriptlanguage="javascript"><!-- functionchecknum(str){return!/\d/.test(str)} alert(checknum("1232142141")) alert(checknum("123214214a1")) file://--></script> 20.獲得一個(gè)窗口的大小 document.body.clientwidth,document.body.clientheight document.body.offsetwidth,document.body.offsetheight 有時(shí)還需要知道window.screentop,window.screenleft 21.怎么判斷是否含有漢字 if(escape(str).indexof("%u")!=-1)alert("含有漢字"); elsealert("全是字符"); 22.textarea自適應(yīng)文字行數(shù)的多少 ie5.5+可以用overflow-y:visible <textarearows=1name=s1cols=27style="overflow-y:visible"> </textarea> 23.日期減去天數(shù)等于第二個(gè)日期 <scriptlanguage=javascript> functioncc(dd,dadd) { file://可以加上錯(cuò)誤處理 vard=newdate(dd.replace("-","/")) d.setdate(d.getdate()+dadd) alert(d.getfullyear()+"年"+(d.getmonth()+1)+"月"+d.getdate()+"日") } cc("2002-2-28",2) </script>
|