18. The web page will not be cached
HTM web page
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache,
must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997
08:21:57 GMT">
Or <META HTTP-EQUIV="expires" CONTENT="0">
ASP web page
= -1
= Now() - 1
= "no-cache"
PHP Web Page
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
19. Check whether a string is composed of numbers
<script language="Javascript"><!--
function checkNum(str){return (/\D/)==null}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// --></script>
20. Get the size of a window
,
21. How to determine whether it is a character
if (/[^\x00-\xff]/(s)) alert("Contains Chinese characters");
else alert("all characters");
How many lines of adaptive text
<textarea rows=1 name=s1 cols=27
onpropertychange="=">
</textarea>
23. Date minus days equal to the second date
<script language=Javascript>
function cc(dd,dadd)
{
//Error processing can be added
var a = new Date(dd)
a = ()
a = a - dadd * 24 * 60 * 60 * 1000
a = new Date(a)
alert(() + "year" + (() + 1) + "month" +
() + "day")
}
cc("12/23/2002",2)
</script>
24. Which Radio was selected
<HTML><script language="vbscript">
function checkme()
for each ob in radio1
if then
next
end function
</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. Obtain the ("") collection of urls on this page
"<TABLE border=1><!-- Table Header
--><TR><TD><B>Variables</B></TD><TD><B>Value</B></TD></TR>"
for each ob in
"<TR><TD>"&ob&"</TD><TD>"&(ob)&"</TD>
</TR>"
next
"</TABLE>"
26.
Native ip<%=("remote_addr")%>
Server name <%=("SERVER_NAME")%>
Server IP<%=("LOCAL_ADDR")%>
Server port <%=("SERVER_PORT")%>
Server time <%=now%>
IIS version<%="SERVER_SOFTWARE")%>
Script timeout <%=%>
The path of this file
<%=(("SCRIPT_NAME"))%>
Number of server CPUs
<%=("NUMBER_OF_PROCESSORS")%>
Server Interpretation Engine <%=ScriptEngine & "/"&
ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."&
ScriptEngineBuildVersion %>
Server operating system <%=("OS")%>
The key moves the cursor to the next input box
<input onkeydown="if(==13)=9">
28. Detect the link speed of a certain website:
Add the following code to the <body> area:
<script language=Javascript>
tim=1
setInterval("tim++",100)
b=1
var autourl=new Array()
autourl[1]=""
autourl[2]="javacool."
autourl[3]=""
autourl[4]=""
autourl[5]=""
function butt(){
("<form name=autof>")
for(var i=1;i<;i++)
("<input type=text name=txt"+i+" size=10
value=In test...> =》<input type=text name=url"+i+" size=40>
=》<input type=button value=GO
onclick=("+i+".value)><br/>")
("<input type=submit value=refresh></form>")
}
butt()
function auto(url){
[0]["url"+b].value=url
if(tim>200)
{[0]["txt"+b].value="Link timeout"}
else
{[0]["txt"+b].value="Time"+tim/10+"seconds"}
b++
}
function run(){for(var
i=1;i<;i++)("<img
src=http://"+autourl[i]+"/"+()+" width=1 height=1
onerror=auto('http://"+autourl[i]+"')>")}
run()</script>
29. Various styles of cursors
auto: standard cursor
default: standard arrow
hand: hand cursor
wait : Wait for the cursor
text: I-shaped cursor
vertical-text: horizontal I-shaped cursor
no-drop: The cursor cannot be dragged
not-allowed: Invalid cursor
help :?Help cursor
all-scroll: triangle direction mark
move: mobile tag
crosshair: crosshair
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize
30. No cache locally, refresh automatically every time
=0
"pragma" , "no-cache"
"cache-control" , "private"
31. Modify contentType and download gif and other formats
<%
function dl(f,n)
on error resume next
set s=CreateObject("")
=3
32. Check whether a string is composed of numbers
<script language="Javascript"><!--
function checkNum(str){return !/\D/.test(str)}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// --></script>
33. Get the size of a window
,
,
Sometimes you need to know,
34. How to determine whether Chinese characters are included
if (escape(str).indexOf("%u")!=-1) alert("Contains Chinese characters");
else alert("all characters");
How many lines of adaptive text
IE 5.5+ can be used overflow-y:visible
<textarea rows=1 name=s1 cols=27 style="overflow-y:visible">
</textarea>
35. Date minus days equal to the second date
<script language=Javascript>
function cc(dd,dadd)
{
//Error processing can be added
var d = new Date(("-","/"))
(()+dadd)
alert(() + "year" + (() + 1) + "month" +
() + "day")
}
cc("2002-2-28",2)
</script>
=1
((f))
if >0 then
& ":" &
else
="application/x-gzip"
"Content-Disposition:","attachment; filename=" & n
(())
end if
end function
call dl("","")
%>
Previous page1234567891011121314151617181920Next pageRead the full text