Web Page Production Essence Code

zhaozj2021-02-16  46

1.οncοntextMenu = "Window.Event.ReturnValue = false" will be thoroughly shielded

NO Can be used for TABLE

2. Cancel the selected 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 (" http_x_forwarded_for ") endif by%>

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 <-! Functiongetie () dimt, l, a, bseta = document.all.img1t = document.all.img1.offsettopl = document.all.img1.offsetleftwhilea.tagname <> "body" set = 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

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

JavaScript: Document.referrer

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

This example is applicable to IE

17. <% Define Some constant constadopenforwardnly = 0 Cursor only browse records forward, not supported by reference, RecordSet, BookmarkConstadopenKeyset = 1 key set cursor, other users say the modification of the record will be reflected in the record set, but other users Increase or delete the record will not be 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 recordset to records, add or delete records to records. 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 move constadlockreadonly = 1 lock type, default, read-only, can not make any modification constadlockpessimistic = 2 When editing, lock records immediately, the safest way constadlockoptimistic = 3 is only locked when calling the Update method And other operations in previous operations can still change, insert and delete for current records, plugbatchoptimistic = 4 When editing is not locked, the changes, insert, and deletion are completed in batch mode

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 text How much 23. Date minus the number of days is equal to the second date < ScriptLanguage = JavaScript> FunctionCC (DD, DADD) {// can be added to handle processing VARA = NewDate (DD) a = a.Valueof () a = a-dadd * 24 * 60 * 60 * 1000A = NewDate (a) alert (A.Getfullyear () "year" 1) "Month" A.Getdate () "Japanese")} 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) & " " NextResponse.write ""

26. Native IP <% = Request.serverVariables ("remote_addr")%> Server Name <% = Request.ServerVariables ("server_name")%> Server IP <% = Request.serverVariables ("local_addr")%> server port <% = Request.SerVariables ("Server_Port")%> Server Time <% = NOW%> IIS version <% = request.servervariables "server_software")%> Script timeout <% = server.scripttimeout%> This file path < % = server.mappath (request.servervariables ( "script_name"))%> number of servers cpu <% = request.servervariables ( "number_of_processors")%> decipher engine server <% = scriptengine & "/" & scriptenginemajorversion & "." & Scriptengineminorversion & "." & Scriptenginebuildversion%> Server operating system <% = request.serverVariables ("OS")%> 27.Enter key to move the cursor 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 (" ")} button {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 ")} Run () 29. Various styles of cursor auto: standard cursor default: Standard arrows: Hand cursor WAIT: Wait Cursor TEXT: I-shaped spectros VERTICAL-TEXT: Horizontal I-shaped NO-DROP: Unable to drag cursor not-allowed: invalid cursor HELP: Help Cursor All-scroll: Triangle Barrier Move: Mobile CROSSHAIR: Ten Board E-Resizen-Resizesw-Resize - Resizesw-Resize

1. There is no cache, each automatically refreshes response.expires = 0Response.addheader "pragma", "no-cache" response.addheader "cache-control", "private"

2. Modify ContentType and download the 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) endifendfunctionCallDL (" 01292501.gif "," t1.gif ")% >

19. Check if a string is fully constructed

20. Get the size of a window Document.Body.ClientWidth, Document.Body.clientHEightDocument.body.offsetWidth, Document.Body.OffsetHeight Sometimes you need to know Window.ScreenTop, Window.Screenleft

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

22. TEXTAREA adaptive text How much IE5.5 can use overflow-y: visible

23. Date minus the number of days is equal to the second date FunctionCC (DD, DADD) {// can add error handling VARD = NewDate (DD.Replace ("-", "/")) D.Setdate (D.Getdate () DADD) ALERT (D.Getfullyear () "Year" (D.GETMONTH () 1) "Month" D.Getdate () "Day")} cc ("2002 -2-28 ", 2)

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

New Post(0)