<inputtype=buttonvalue=最小化onclick=hh1.click()>
<inputtype=buttonvalue=最大化onclick=hh2.click()>
<inputtype=buttonvalue=关闭onclick=hh3.click()>
本例适用于ie
17.
<%
定义数据库连接的一些常量
constadopenforwardonly=0游标只向前浏览记录,不支持分页、recordset、bookmark
constadopenkeyset=1键集游标,其他用户对记录说做的修改将反映到记录集中,但其他用户增加或删除记录不会反映到记录集中。支持分页、recordset、bookmark
constadopendynamic=2动态游标功能最强,但耗资源也最多。用户对记录说做的修改,增加或删除记录都将反映到记录集中。支持全功能浏览(access不支持)。
constadopenstatic=3静态游标,只是数据的一个快照,用户对记录说做的修改,增加或删除记录都不会反映到记录集中。支持向前或向后移动
constadlockreadonly=1锁定类型,默认的,只读,不能作任何修改
constadlockpessimistic=2当编辑时立即锁定记录,最安全的方式
constadlockoptimistic=3只有在调用update方法时才锁定记录集,而在此前的其他操作仍可对当前记录进行更改、插入和删除等
constadlockbatchoptimistic=4当编辑时记录不会被锁定,而更改、插入和删除是在批处理方式下完成的
constadcmdtext=&h0001
constadcmdtable=&h0002
%>
18.网页不会被缓存
htm网页
<metahttp-equiv="pragma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-revalidate">
<metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">
或者<metahttp-equiv="expires"content="0">
asp网页
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"
php网页
header("expires:mon,26jul199705:00:00gmt");
header("cache-control:no-cache,must-revalidate");
header("pragma:no-cache");
19.检查一段字符串是否全由数字组成
<scriptlanguage="javascript"><!--
functionchecknum(str){returnstr.match(/\d/)==null}
alert(checknum("1232142141"))
alert(checknum("123214214a1"))
//--></script>
20.获得一个窗口的大小
document.body.clientwidth,document.body.clientheight
21.怎么判断是否是字符
if(/[^\x00-\xff]/g.test(s))alert("含有汉字");
elsealert("全是字符");
22.textarea自适应文字行数的多少
<textarearows=1 name=s1 cols=27 onpropertychange="this.style.posheight=this.scrollheight">
</textarea>
23.日期减去天数等于第二个日期
<scriptlanguage=javascript>
functioncc(dd,dadd)
{
//可以加上错误处理
vara=newdate(dd)
a=a.valueof()
a=a-dadd*24*60*60*1000
a=newdate(a)
alert(a.getfullyear()+"年"+(a.getmonth()+1)+"月"+a.getdate()+"日")
}
cc("12/23/2002",2)
</script>
24.选择了哪一个radio
<html><scriptlanguage="vbscript">
functioncheckme()
foreachobinradio1
ifob.checkedthenwindow.alertob.value
next
endfunction
</script><body>
<input name="radio1" type="radio" value="style" checked>style
<input name="radio1" type="radio" value="barcode">barcode