ASP is common!

xiaoxiao2021-03-06  40

<% Response.write "1.οncοntextmenu =" window.event.returnvalue = false "will completely shield Right no may be used to table 2. Cancel the selection to prevent copy

3.οnpaste = "Returnfalse" is not allowed to paste

4.οcuepy = "Returnfalse;" oncut = "returnfalse;" Prevent copy

5. IE IE addressed to my own icon

6. You can display your icon in your favorites

7. Close input method

8. I will always bring the frame

9. Prevent people from frame

10.

11. http://www.9cbs.net / ";;;>

12. How to check if the visitors use the agent <% ifrequest.servervariables <% ifrequest.servervariables <% iFrequest.ServerVariables <> "" "" "" "" "" "& _" true IP "& Request.serverVariables") Endif "%> <% response.write" 13. Absolute location of the control

//javascriptfunctiongetie (E) {oE.Offsetlettop; varl=e.offsetLeft;while (E=E.OffsetParent)} =E.offsettop;} =E.offsetleft;}}}}}} = ("TOP =" T "/ NLEFT =" L);} // vbscript "body" seta = a.offsetparentt = t a.offsettopl = l a.offsetleftwendmsgbox "top =" & t & chr (13) & "Left =" & l, 64, "Get the position of the control" Endfunction ->

14. The cursor is the last FunctionCC () {Vare = Event.Srcelement; varR = E.CREATEXTRANGE (); R.MOVESTART (CHARACTER, E.Value.LENGTH); R; .collapse (true); r.select ();}

15. Judgment the source ASP: Request.ServerVariables ("http_referer")

Java Script: Document.referrer

16. Minimize, maximize, close window < Paramname = "Command" value = "close">

This example is applicable to IE17. <% Defined Database Connection Some constant constadopenforwardonly = 0 cursors only browse records, do not support paging, recordset, bookmarkconstadopenkeyset = 1 key set cursor, other users do what modifications to records will be reflected in the record set, but other users increase or Deleting records are not reflected in the record set. Support paging, recordset, bookmarkconstadopndynamic = 2 dynamic cursor function, but the resources are also most. The user will be reflected in the record set. Support full-featured browsing (Access is not supported). ConstadopenStatic = 3 static cursor, just a snapshot of data, users do not reflect the record set by modifications, increase or delete records for records. Support forward or backward movement

ConstadlockReadOnly = 1 lock type, default, read-only, can not make any modification constadlockpessimistic = 2 When editing, lock the record immediately, the safest way constadlockoptimistic = 3 is only locked in the UPDATE method, while the recording set is locked, while before other operations CONSTADLOCKBATCHOPTIMISTIC = 4 can still be changed, inserted, and deleted for current records, and records when editing is not locked, and change, insert, and delete is done in batch processing.

Constadcmdtext = & H0001Constadcmdtable = & H0002 "%>

18. Web pages are not cached HTM web page or asp page response.expires = -1response.expiresabsolute = now () - 1response.cachecontrol = "No-cache" PHP page Header ("Expires: MON, 26JUL199705: 00: 00GMT"); Header ("Cache-Control: No-cache, Must-revALIDATE"); Header ("Pragma: no-cache") ;

19. Check if a string is fully consisting of numbers 20. Get the size of a window Document.Body.ClientWidth, Document.Body.ClientHeight

21. How to determine if it is a character if (/ [^ / x00- / xff] /g.test (s)) ALERT ("with Chinese characters"); Elsealert ("all characters");

22. TEXTAREA Adaptive Writing How much

23. Date minus the number of days is equal to the second date FunctionCC (DD, DADD) {// can add error handling VARA = NewDate (DD) a = a.Valueof () a = a-dadd * 24 * 60 * 60 * 1000A = newdate (a) Alert (A.Getfullyear () "year" (a.getmonth () 1) "Month" A.GetDate () "Day")} cc ( "12/23/2002", 2)

24. Select which one radio functioncheckme () foreachobinradio1ifob.checkedthenwindow.alertob.valuenextendfunction style barode

25. Request.ServerVariables ("") collection response.write " Value "ForeachobinRequest.serverVariableSRESRESRESRESRESPONSE.WRITE" "& Ob &" "& Request.ServerVariables (OB) & " " Next "" "26. Native IP <% = Request.serverVariables (" remote_addr ")%> Server Name <% = Request.ServerVariables (" Server_name ") %> Server IP <% = Request.ServerVariables ("local_addr")%> server port <% = request.servervariables ("server_port")%> server time <% = no%> IIS version <% = request.servervariables "Server_software ")%> Script timeout <% = server.scripttimeout%> This file path <% = server.mAppath (Request.ServerVariables (" script_name ")%> Server CPU number <% = Request.ServerVariables (" Number_of_Processors ") %> Server Execution Engine <% = Scriptengine & "/" & Scriptenginemajorversion & "." & Scriptengineminorversion "." & Scriptenginebuildversion%> server operating system <% = Request.ServerVariables ("OS")%>

27.enter key allows the cursor to move to the next input box

28. Detect a link speed of a website: add the following code in the area: TIM = 1setInterval ("Tim ", 100) b = 1

Varautource = newArray () Autourl [1] = " www.njcatv.net" autOrl [2] = "javacool.3322.net" autOrl [3] = " www.sina.com.cn" autOrl [4] = "www.nua.edu.cn" autOrl [5] = " www.cctv.com "FunctionButt () {document.write (" ") for (vari = 1; i =" = " ") Document.write (" ")} Butt () FunctionAuto (URL) {Document .form [0] ["URL" b] .Value = urlif (Tim> 200) {document.forms [0] ["txt" b] .value = "link timeout"} else {document.forms [0 ] ["txt" b] .value = "time" TIM / 10 "second"} b } functionRun () {for (vari = 1; i http: // "; ;; autOourn ")>")} Run ()

29. Various styles of cursor Auto: Standard Cursor Default: Standard Arrows: Hand Cursor Wait: Wait Cursor TEXT: I-shaped Sports Vertical-TEXT: Level I Skal NOD DROP: Unable to Dragon Cursor Not-Allowed: Invalid Cursor Help: Help Cursor All-Scroll: Triangle Barrier Move: Moved CROSSHAIR: Ten Marker E-Resizen-ResizN ResizeW-Resizes-Resort-Resizesw-Resize 30. None of the local, automatically refresh Response.expires = 0Response. Addheader "Pragma", "No-Cache" Response.addheader "Cache-Control", "Private"

31. Modify ContentType and download GIF format <% FunctionDL (f, n) OneRrorResumenext

sets = createobject ( "adodb.stream") s.mode = 3s.type = 1s.opens.loadfromfile (server.mappath (f)) iferr.number> 0thenresponse.writeerr.number & ":" & err.descriptionelseresponse.contenttype = " Application / X-Gzip "response.addheader" Content-Disposition: "," attachment; filename = "& nresponse.binaryWrite (S.Size) endifendfunction

CallDL ("01292501.GIF", "T1.GIF")%>

32. Check if a string is fully consisting of numbers

33. Get a window size document.body.clientWidth, Document.Body.clientHeightDocument.body.offsetWidth, Document.Body.OffsetHeight Sometimes you need to know Window.ScreenTop, Window.Screenleft

34. How to determine whether there is a Chinese character if ("% u")! = - 1) Alert ("with Chinese characters"); Elsealert ("all characters");

35. TEXTAREA Adaptive Writing How much IE5.5 can use overflow-y: Visible

转载请注明原文地址:https://www.9cbs.com/read-74172.html

New Post(0)