cAng^Er

          不懂我的人 , 離不了我 , 該了解了解我 !而懂我的人 , 更離不了我 , 因為他們愛我 。

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            30 隨筆 :: 16 文章 :: 18 評論 :: 0 Trackbacks
          1. 1.? oncontextmenu = "window.event.returnValue=false" ?將徹底屏蔽鼠標右鍵 < table ?border? oncontextmenu = return (false) > < td > no </ table > ?可用于Table??
          2. 2.<body?onselectstart="returnfalse">取消選取、防止復制??
          3. 3.onpaste = "returnfalse" ?不準粘貼??
          4. 4.?oncopy="return?false;"?oncut="return?false;"?防止復制??
          5. 5.?<link?rel="Shortcut?Icon"?href="favicon.ico">?IE地址欄前換成自己的圖標??
          6. 6.?<link?rel="Bookmark"?href="favicon.ico">?可以在收藏夾中顯示出你的圖標??
          7. 7.<input?style="ime-mode:disabled">?關(guān)閉輸入法??
          8. 8.?永遠都會帶著框架??
          9. < script ? language = "Javascript" > <!--??
          10. if?(window?==?top)top.location.href?=?"frames.htm";?//frames.htm為框架網(wǎng)頁??
          11. //?--></script>??
          12. ??
          13. 9.?防止被人frame??
          14. < script ? LANGUAGE = JAVAscript > <!--???
          15. if?(top.location?!=?self.location)top.location=self.location;??
          16. //?--></script>??
          17. ??
          18. 10.?<noscript><iframe?src=*.html></iframe></noscript>?網(wǎng)頁將不能被另存為??
          19. ??
          20. 11.?<input?type=button?value=查看網(wǎng)頁源代碼???
          21. onclick = "window.location?=?'view-source:'+?'http://www.csdn.net/'" > ??
          22. ??
          23. 12.?怎樣通過asp的手段來檢查來訪者是否用了代理??
          24. < %?if?Request.ServerVariables("HTTP_X_FORWARDED_FOR") < > ""?then??
          25. response.write?"<font?color=#FF0000>您通過了代理服務(wù)器,"&?_??
          26. "真實的IP為"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")??
          27. end?if??
          28. %>??
          29. ??
          30. 13.?取得控件的絕對位置??
          31. ??
          32. //Javascript??
          33. < script ? language = "Javascript" > ??
          34. function?getIE(e){??
          35. var?t=e.offsetTop;??
          36. var?l=e.offsetLeft;??
          37. while(ee=e.offsetParent){??
          38. t+=e.offsetTop;??
          39. l+=e.offsetLeft;??
          40. }??
          41. alert("top="+t+"\nleft="+l);??
          42. }??
          43. </ script > ??
          44. ??
          45. //VBscript??
          46. < script ? language = "VBscript" > <!--??
          47. function?getIE()??
          48. dim?t,l,a,b??
          49. set?a=document.all.img1??
          50. t = document .all.img1.offsetTop??
          51. l = document .all.img1.offsetLeft??
          52. while?a.tagName<>"BODY"??
          53. set?aa?=?a.offsetParent??
          54. t t =t+a.offsetTop??
          55. l l =l+a.offsetLeft??
          56. wend??
          57. msgbox?"top="&t&chr(13)&"left="&l,64,"得到控件的位置"??
          58. end?function??
          59. --></script>??
          60. ??
          61. 14.?光標是停在文本框文字的最后??
          62. < script ? language = "javascript" > ??
          63. function?cc()??
          64. {??
          65. var?e?=?event.srcElement;??
          66. var?r?=e.createTextRange();??
          67. r.moveStart('character',e.value.length);??
          68. r.collapse(true);??
          69. r.select();??
          70. }??
          71. </ script > ??
          72. < input ? type = text ? name = text1 ? value = "123" ? onfocus = "cc()" > ??
          73. ??
          74. 15.?判斷上一頁的來源??
          75. asp:??
          76. request.servervariables("HTTP_REFERER")??
          77. ??
          78. javascript:??
          79. document.referrer??
          80. ??
          81. 16.?最小化、最大化、關(guān)閉窗口??
          82. < object ? id = hh1 ? classid = "clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11" > ???
          83. < param ? name = "Command" ? value = "Minimize" > </ object > ??
          84. < object ? id = hh2 ? classid = "clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11" > ???
          85. < param ? name = "Command" ? value = "Maximize" > </ object > ??
          86. < OBJECT ? id = hh3 ? classid = "clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" > ??
          87. < PARAM ? NAME = "Command" ? VALUE = "Close" > </ OBJECT > ??
          88. ??
          89. < input ? type = button ? value =最小化? onclick = hh1 .Click() > ??
          90. < input ? type = button ? value =最大化? onclick = hh2 .Click() > ??
          91. < input ? type = button ? value =關(guān)閉? onclick = hh3 .Click() > ??
          92. 本例適用于IE??
          93. ??
          94. 17.???
          95. < %??
          96. '定義數(shù)據(jù)庫連接的一些常量??
          97. Const?adOpenForwardOnly?=?0?'游標只向前瀏覽記錄,不支持分頁、Recordset、BookMark??
          98. Const?adOpenKeyset?=?1?'鍵集游標,其他用戶對記錄說做的修改將反映到記錄集中,但其他用戶增加或刪除記錄不會反映到記錄集中。支持分頁、Recordset、BookMark??
          99. Const?adOpenDynamic?=?2?'動態(tài)游標功能最強,但耗資源也最多。用戶對記錄說做的修改,增加或刪除記錄都將反映到記錄集中。支持全功能瀏覽(ACCESS不支持)。??
          100. Const?adOpenStatic?=?3?'靜態(tài)游標,只是數(shù)據(jù)的一個快照,用戶對記錄說做的修改,增加或刪除記錄都不會反映到記錄集中。支持向前或向后移動??
          101. ??
          102. Const?adLockReadOnly?=?1?'鎖定類型,默認的,只讀,不能作任何修改??
          103. Const?adLockPessimistic?=?2?'當編輯時立即鎖定記錄,最安全的方式??
          104. Const?adLockOptimistic?=?3?'只有在調(diào)用Update方法時才鎖定記錄集,而在此前的其他操作仍可對當前記錄進行更改、插入和刪除等??
          105. Const?adLockBatchOptimistic?=?4?'當編輯時記錄不會被鎖定,而更改、插入和刪除是在批處理方式下完成的??
          106. ??
          107. Const?adCmdText?=?&H0001??
          108. Const?adCmdTable?=?&H0002??
          109. %>??
          110. ??
          111. 18.?網(wǎng)頁不會被緩存??
          112. HTM網(wǎng)頁??
          113. < META ? HTTP-EQUIV = "pragma" ? CONTENT = "no-cache" > ??
          114. < META ? HTTP-EQUIV = "Cache-Control" ? CONTENT = "no-cache,?must-revalidate" > ??
          115. < META ? HTTP-EQUIV = "expires" ? CONTENT = "Wed,?26?Feb?1997?08:21:57?GMT" > ??
          116. 或者<META?HTTP-EQUIV="expires"?CONTENT="0">??
          117. ASP網(wǎng)頁??
          118. Response.Expires ?=?-1??
          119. Response.ExpiresAbsolute ?=? Now ()?-?1??
          120. Response.cachecontrol ?=? "no-cache" ??
          121. PHP網(wǎng)頁??
          122. header("Expires:?Mon,?26?Jul?1997?05:00:00?GMT");??
          123. header("Cache-Control:?no-cache,?must-revalidate");??
          124. header("Pragma:?no-cache");??
          125. ??
          126. 怎樣讓表單沒有凹凸感???
          127. < input ? type = text ? style = "border:1?solid?#000000" > ???
          128. 或??
          129. < input ? type = text ? style = "border-left:none;?border-right:none;?border-top:none;?border-bottom:?1?solid?#000000" > </ textarea > ??
          130. ??
          131. < div > < span > & < layer > 的區(qū)別????
          132. < div > (division)用來定義大段的頁面元素,會產(chǎn)生轉(zhuǎn)行???
          133. < span > 用來定義同一行內(nèi)的元素,跟 < div > 的唯一區(qū)別是不產(chǎn)生轉(zhuǎn)行???
          134. < layer > 是ns的標記,ie不支持,相當于 < div > ??
          135. ??
          136. 讓彈出窗口總是在最上面:??
          137. < body ? onblur = "this.focus();" > ??
          138. ??
          139. 不要滾動條????
          140. 讓豎條沒有:???
          141. < body ? style = 'overflow:scroll;overflow-y:hidden' > ???
          142. </ body > ???
          143. 讓橫條沒有:???
          144. < body ? style = 'overflow:scroll;overflow-x:hidden' > ???
          145. </ body > ???
          146. 兩個都去掉?更簡單了???
          147. < body ? scroll = "no" > ???
          148. </ body > ???
          149. ??
          150. 怎樣去掉圖片鏈接點擊后,圖片周圍的虛線???
          151. < a ? href = "#" ? onFocus = "this.blur()" > < img ? src = http ://www.chinaitpower.com/A/2005-01-22/"logo.jpg"? border = 0 > </ a > ??
          152. ??
          153. 電子郵件處理提交表單??
          154. < form ? name = "form1" ? method = "post" ? action = "mailto:****@***.com" ? enctype = "text/plain" > ???
          155. < input ? type = submit > ??
          156. </ form > ??
          157. ??
          158. 在打開的子窗口刷新父窗口的代碼里如何寫???
          159. window.opener.location.reload()??
          160. ??
          161. 如何設(shè)定打開頁面的大小??
          162. < body ? onload = "top.resizeTo(300,200);" > ??
          163. ??
          164. 在頁面中如何加入不是滿鋪的背景圖片,拉動頁面時背景圖不動???
          165. < html > < head > ???
          166. < STYLE > ???
          167. body???
          168. {background-image:url(logo.gif);?background-repeat:no-repeat;?background-position:center?}???
          169. </ STYLE > ???
          170. </ head > ???
          171. < body ? bgproperties = "fixed" ? > ???
          172. </ body > ???
          173. </ html > ???
          174. ??
          175. 19.?檢查一段字符串是否全由數(shù)字組成??
          176. < script ? language = "Javascript" > <!--??
          177. function?checkNum(str){return?str.match(/\D/)==null}??
          178. alert(checkNum("1232142141"))??
          179. alert(checkNum("123214214a1"))??
          180. //?--></script>??
          181. ??
          182. 20.?獲得一個窗口的大小??
          183. document.body.clientWidth,document.body.clientHeight??
          184. ??
          185. 21.?怎么判斷是否是字符??
          186. if?(/[^\x00-\xff]/g.test(s))?alert("含有漢字");??
          187. else?alert("全是字符");??
          188. ??
          189. 22.TEXTAREA自適應(yīng)文字行數(shù)的多少??
          190. < textarea ? rows = 1 ? name = s1 ? cols = 27 ? onpropertychange = "this.style.posHeight=this.scrollHeight" > ??
          191. </ textarea > ??
          192. ??
          193. 23.?日期減去天數(shù)等于第二個日期??
          194. < script ? language = Javascript > ??
          195. function?cc(dd,dadd)??
          196. {??
          197. //可以加上錯誤處理??
          198. var?a?=?new?Date(dd)??
          199. a a ?=?a.valueOf()??
          200. a a ?=?a?-?dadd?*?24?*?60?*?60?*?1000??
          201. a ?=? new ?Date(a)??
          202. alert(a.getFullYear()?+?"年"?+?(a.getMonth()?+?1)?+?"月"?+?a.getDate()?+?"日")??
          203. }??
          204. cc("12/23/2002",2)??
          205. </ script > ??
          206. ??
          207. 24.?選擇了哪一個Radio??
          208. < HTML > < script ? language = "vbscript" > ??
          209. function?checkme()??
          210. for?each?ob?in?radio1??
          211. if?ob.checked?then?window.alert?ob.value??
          212. next??
          213. end?function??
          214. </ script > < BODY > ??
          215. < INPUT ? name = "radio1" ? type = "radio" ? value = "style" ?checked > Style??
          216. < INPUT ? name = "radio1" ? type = "radio" ? value = "barcode" > Barcode??
          217. < INPUT ? type = "button" ? value = "check" ? onclick = "checkme()" > ??
          218. </ BODY > </ HTML > ??
          219. ??
          220. 25.獲得本頁url的request.servervariables("")集合??
          221. Response.Write?"<TABLE?border=1><!--?Table?Header?--><TR><TD><B>Variables</B></TD><TD><B>Value</B></TD></TR>"??
          222. for?each?ob?in?Request.ServerVariables??
          223. Response.Write?"<TR><TD>"&ob&"</TD><TD>"&Request.ServerVariables(ob)&"</TD></TR>"??
          224. next??
          225. Response.Write?"</TABLE>"??
          226. ??
          227. 26.??
          228. 本機ip<%=request.servervariables("remote_addr")%>??
          229. 服務(wù)器名<%=Request.ServerVariables("SERVER_NAME")%>??
          230. 服務(wù)器IP<%=Request.ServerVariables("LOCAL_ADDR")%>??
          231. 服務(wù)器端口<%=Request.ServerVariables("SERVER_PORT")%>??
          232. 服務(wù)器時間<%=now%>??
          233. IIS版本<%=Request.ServerVariables"SERVER_SOFTWARE")%>??
          234. 腳本超時時間<%=Server.scriptTimeout%>??
          235. 本文件路徑<%=server.mappath(Request.ServerVariables("script_NAME"))%>??
          236. 服務(wù)器CPU數(shù)量<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>??
          237. 服務(wù)器解譯引擎<%=scriptEngine?&?"/"&?scriptEngineMajorVersion?&"."&scriptEngineMinorVersion&"."&?scriptEngineBuildVersion?%>??
          238. 服務(wù)器操作系統(tǒng)<%=Request.ServerVariables("OS")%>??
          239. ??
          240. 27.ENTER鍵可以讓光標移到下一個輸入框??
          241. < input ? onkeydown = "if(event.keyCode==13)event.keyCode=9" > ??
          242. ??
          243. 28.?檢測某個網(wǎng)站的鏈接速度:??
          244. 把如下代碼加入<body>區(qū)域中:??
          245. < script ? language = Javascript > ??
          246. tim = 1 ??
          247. setInterval("tim++",100)??
          248. b = 1 ??
          249. ??
          250. var?autourl=new?Array()??
          251. autourl[1]="www.njcatv.net"??
          252. autourl[2]="javacool.3322.net"??
          253. autourl[3]="www.sina.com.cn"??
          254. autourl[4]="www.nuaa.edu.cn"??
          255. autourl[5]="www.cctv.com"??
          256. ??
          257. function?butt(){??
          258. document.write("<form?name=autof>")??
          259. for(var?i=1;i<autourl.length;i++)??
          260. document.write("<input?type=text?name=txt"+i+"?size=10?value=測試中……>?=》<input?type=text?name=url"+i+"?size=40>?=》<input?type=button?value=GO?onclick=window.open(this.form.url"+i+".value)><br>")??
          261. document.write("<input?type=submit?value=刷新></form>")??
          262. }??
          263. butt()??
          264. function?auto(url){??
          265. document.forms[0]["url"+b].value=url??
          266. if(tim>200)??
          267. {document.forms[0]["txt"+b].value="鏈接超時"}??
          268. else??
          269. {document.forms[0]["txt"+b].value="時間"+tim/10+"秒"}??
          270. b++??
          271. }??
          272. function?run(){for(var?i=1;i<autourl.length;i++)document.write("<img?src=http://"+autourl+"/"+Math.random()+"?width=1?height=1?onerror=auto('http://";+autourl+"')>")}??
          273. run()</script>??
          274. ??
          275. 29.?各種樣式的光標??
          276. auto?:標準光標??
          277. default?:標準箭頭??
          278. hand?:手形光標??
          279. wait?:等待光標??
          280. text?:I形光標??
          281. vertical-text?:水平I形光標??
          282. no-drop?:不可拖動光標??
          283. not-allowed?:無效光標??
          284. help?:?幫助光標??
          285. all-scroll?:三角方向標??
          286. move?:移動標??
          287. crosshair?:十字標??
          288. e-resize??
          289. n-resize??
          290. nw-resize??
          291. w-resize??
          292. s-resize??
          293. se-resize??
          294. sw-resize
          295. 原文地址:http://www.wujianrong.com/archives/2006/11/web_8.html
          posted on 2007-01-15 10:33 cAng^Er 閱讀(183) 評論(0)  編輯  收藏 所屬分類: |:Web Design:|

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 深泽县| 濮阳市| 屯昌县| 庆安县| 嘉善县| 屯门区| 天水市| 虞城县| 鹿泉市| 澜沧| 云林县| 永和县| 沁水县| 哈巴河县| 文化| 鸡西市| 江山市| 沽源县| 措勤县| 东阳市| 华池县| 绥芬河市| 甘谷县| 秦皇岛市| 望谟县| 阜平县| 禹城市| 崇信县| 治多县| 交口县| 郎溪县| 察隅县| 墨脱县| 水富县| 南雄市| 陆良县| 宜宾县| 长泰县| 虎林市| 西和县| 儋州市|