1、取變數類型typeof($js_libpath) = undefined下拉選單下拉選單.options索引下拉選單.options.length搜尋對象document.getElementsByName(r1document.getElementById(id);定時timer=setInterval(scrollwindow(),delay);clearInterval(timer);UNCODE編碼escape() ,unescape父對象obj.parentElement(dhtml)obj.parentNode(dom)交換表的行TableID.moveRow(2,1)代換CSSd
2、ocument.all.csss.href = a.css;並排顯示display:inline隱藏焦點hidefocus=true根據寬度換行style=word-break:break-all自動Reload簡單郵件a href=mailto:aaa?subject=ccc&body=xxxyyy快速轉到位置obj.scrollIntoView(true)錨a name=first#firstanchors網頁傳遞參數location.search();可編輯obj.contenteditable=true執行選單命令obj.execCommand雙字元字元/x00-xff/漢字/u4e0
3、0-u9fa5/讓英文字元串超出表格寬度自動換行word-wrap: break-word; word-break: break-all;透明背景IFRAME src=1.htm width=300 height=180 allowtransparency/iframe獲得style內容obj.style.cssTextHTML標籤document.documentElement.innerHTML第一個style標籤document.styleSheets0style標籤裡的第一個樣式document.styleSheets0.rules0防止點選空連結時,頁面往往重置到頁首端java sc
4、ript:function()wordiframe src=*.htm/noscript禁止選取body oncontextmenu=return false ondragstart= onselectstart = onselect=document.selection.empty() oncopy= onbeforecopy=onmouseup=document.selection.empty()禁止貼上input type=text onpaste=地址欄圖標link rel=Shortcut Icon href=favicon.icofavicon.ico 名字最好不變16*16的16
5、色,放虛擬目錄根目錄下收藏欄圖標Bookmark檢視原始碼input type=button value=檢視網頁源程式碼 onclick=window.location = view-source:+ 關閉輸入法input style=ime-mode:disabled自動全選input type=text name=text1 value=123 onfocus=this.select()ENTER鍵可以讓游標移到下一個輸入框input onkeydown=if(event.keyCode=13)event.keyCode=9文字框的預設值input type=text value=ale
6、rt(this.defaultvalue)title換行obj.title = 123 sdfs 獲得時間所代表的微秒var n1 = new Date(2004-10-10.replace(/-/g, /).getTime()視窗是否關閉win.closedcheckbox扁平input type=checkbox style=position: absolute; clip:rect(5px 15px 15px 5px)br獲取選取內容document.selection.createRange().duplicate().text自動完成功能input type=text autocom
7、plete=on打開該功能input type=text autocomplete=off關閉該功能視窗最大化body onload=window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)無關閉按鈕IEwindows.open(aa.htm, meizzfullscreen=7統一編碼/解碼alert(decodeURIComponent(encodeURIComponent(http:/你好.com?as= hehe)encodeURIComponent對:、/ 和 ?也編碼表
8、格行指示tr onmouseover=this.bgColor=#f0f0f0 onmouseout=#ffffff各種尺寸s += rn網頁可見區域寬:+ document.body.clientWidth;rn網頁可見區域高:+ document.body.clientHeight;+ document.body.offsetWeight + (包括邊線的寬)+ document.body.offsetHeight +rn網頁正文全文寬:+ document.body.scrollWidth;rn網頁正文全文高:+ document.body.scrollHeight;rn網頁被捲去的高:
9、+ document.body.scrollTop;rn網頁被捲去的左:+ document.body.scrollLeft;rn網頁正文部分上:+ window.screenTop;rn網頁正文部分左:+ window.screenLeft;rn螢幕分辨率的高:+ window.screen.height;rn螢幕分辨率的寬:+ window.screen.width;rn螢幕可用工作區高度:+ window.screen.availHeight;rn螢幕可用工作區寬度:+ window.screen.availWidth;過濾數字input type=text onkeypress=ret
10、urn event.keyCode=48&event.keyCode=57|(this.value.indexOf(.)0?event.keyCode=46:false) onpaste=return !clipboardData.getData(text).match(/D/) ondragenter=特殊用途input type=button value=匯入收藏夾 onclick=window.external.ImportExportFavorites(true,/localhostinput type=button value=匯出收藏夾 onclick=window.externa
11、l.ImportExportFavorites(false,input type=button value=整理收藏夾 onclick=window.external.ShowBrowserUI(OrganizeFavorites, null)input type=button value=語言設定 onclick=LanguageDialoginput type=button value=加入收藏夾 onclick=window.external.AddFavorite( google)input type=button value=加入到頻道 onclick=window.external
12、.addChannel(window.external.showBrowserUI(PrivacySettings,null)不快取META HTTP-EQUIV=pragmano-cacheCache-Controlno-cache, must-revalidateexpires0正則匹配匹配中文字元的正則表達式: u4e00-u9fa5匹配雙字元字元(包括漢字在內):x00-xff匹配空行的正則表達式:ns| *r匹配HTML標記的正則表達式:/.*|/匹配首尾空格的正則表達式:(s*)|(s*$)(像vbscript那樣的trim函數)匹配Email地址的正則表達式:w+(-+.w+)*
13、w+(-.w+)*.w+(-.w+)*匹配網址URL的正則表達式:/(w-+.)+w-+(/w- ./?%&=*)?以下是例子:利用正則表達式限制網頁表單裡的文字框輸入內容:用 正則表達式限制只能輸入中文:onkeyup=value=value.replace(/u4E00-u9FA5/g, onbeforepaste=clipboardData.setData(,clipboardData.getData().replace(/u4E00-u9FA5/g,)1. 用正則表達式限制只能輸入全角字元: onkeyup=value=value.replace(/uFF00-uFFFF/g,).re
14、place(/uFF00-uFFFF/g,2. 用正則表達式限制只能輸入數字:value=value.replace(/d/g,) onbeforepaste=).replace(/d/g,3. 用正則表達式限制只能輸入數字和英文:value=value.replace(/W/g,消除圖像工具欄IMG SRC=mypicture.jpg HEIGHT=100px WIDTH= GALLERYIMG=falseorheadmeta http-equiv=imagetoolbar content=no/head無提示關閉function Close()var ua=navigator.userAg
15、entvar ie=navigator.appName=Microsoft Internet Explorertrue:falseif(ie)var IEversion=parseFloat(ua.substring(ua.indexOf(MSIE )+5,ua.indexOf(,ua.indexOf()if(IEversiondocument.body.insertAdjacentHTML(beforeEnd, str);document.all.noTipClose.Click();elsewindows.opener =null;window.close();window.close()
16、取得控件得絕對位置(1) script language=javascriptfunction getoffset(e)var t=e.offsetTop;var l=e.offsetLeft;while(e=e.offsetParent)t+=e.offsetTop;l+=e.offsetLeft;var rec = new Array(1);rec0 = t;rec1 = l;return rec/script獲得控件的絕對位置(2) oRect = obj.getBoundingClientRect();oRect.leftoRect.最小化,最大化,關閉object id=min cl
17、assid=Minimizeobject id=max classid=MaximizeOBJECT id=close classid=adb880a6-d8ff-11cf-9377-00aa003b7a11PARAM NAME=/OBJECTinput type=button value=最小化 onclick=min.Click()input type=button value=最大化 onclick=max.Click()input type=button value=關閉 onclick=close.Click()游標停在文字最後function cc()var e = event.s
18、rcElement;var r =e.createTextRange();r.moveStart(character,e.value.length);r.collapse(true);r.select();cc()頁面進入和登出的特效進入頁面Page-EnterrevealTrans(duration=x, transition=y)推出頁面Page-Exit這個是頁面被載入和調出時的一些特效。duration表示特效的持續時間,以秒為單位。transition表示使用哪種特效,取值為1-23:0 矩形縮小1 矩形擴大2 圓形縮小3 圓形擴大4 下到上Reload5 上到下Reload6 左到
19、右Reload7 右到左Reload8 豎百葉窗9 橫百葉窗10 錯位橫百葉窗11 錯位豎百葉窗12 點擴散13 左右到中間Reload14 中間到左右Reload15 中間到上下16 上下到中間17 右下到左上18 右上到左下19 左上到右下20 左下到右上21 橫條22 豎條23網頁是否被檢索meta name=ROBOTS屬性值其中屬性值有以下一些:屬性值為all 檔案將被檢索,且頁上連結可被查詢;none 檔案不被檢索,而且不查詢頁上的連結;index 檔案將被檢索;follow 查詢頁上的連結;noindex 檔案不檢索,但可被查詢連結;nofollow列印分頁p style=page-break-after:alwayspage1page2function window.onload()/ - advanced featuresfactory.printing.SetMarginMeasure(2) / measure margins in inchesfactory.printing.SetPageRange(false, 1, 3) / need pages from 1 to 3factory.printing.printer =
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1