博文
window.open的参数(2006-12-14 12:03:00)
摘要:<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行
-->
</SCRIPT>
参数解释:
<SCRIPT LANGUAGE="javascript"> js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
</SCRIPT> js脚本结束......
常用正则表达式 (2006-12-02 11:30:00)
摘要:常用正则表达式
(\d{3}-|\d{4}-)?(\d{8}|\d{7})? //国内电话
^[1-9]*[1-9][0-9]*$ //腾讯qq
^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$ //email地址
^[a-za-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\s*)?$ //url
^\d+$ //非负整数
^[0-9]*[1-9][0-9]*$ //正整数
^((-\\d+)|(0+))$ //非正整数
^-[0-9]*[1-9][0-9]*$ //负整数
^-?\\d+$ //整数
^\\d+(\\.\\d+)?$ //非负浮点数
^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$ //正浮点数
^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))$ //非正浮点数
^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))$ //负浮点数
^(-?\\d+)(\\.\\d+)?$ //浮点数
^[a-za-z]+$ //由26个英文字母组成的字符串
^[a-z]+$ //由26个英文字母的大写组成的字符串
^[a-z]+$ //由26个英文字母的小写组成的字符串
^[a-za-z0-9]+$ //由数字和26个英文字母组成的字符串
^\\w+$ //由数字、26个英文字母或者下划线组成的字符串......
既支持图片本地上传又支持Url的方法(2006-11-23 19:10:00)
摘要:<style type="text/css">
<!--
.oyh {
width: 30px;
border: 10px;
height: 22px;
}
-->
</style>
</head>
<script language=javascript>
function f()
{
if(this.form1.file1.value!="")
{
this.form1.aaa.value=this.form1.file1.value;
}
}
</script>
<body>
<form name="form1">
<input type="text" name="aaa"><input name="file1" type="file" class="oyh" onMouseOut="javascript:f()">
</form>
......
复制文件夹中内容的asp代码(2006-11-22 14:11:00)
摘要:<%
domain="123"
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
str123=server.mappath("./aaa")
s1=server.mappath("./")
Set MyFolder=MyFileObject.GetFolder(str123)
For Each thing in MyFolder.Files'复制里面的文件
s=Split(thing,"\")
a=UBound(s)
s3=Split(thing,"\")(a)
MyFileObject.CopyFile thing,s1&"\"&domain&"\"&s3
Next
For Each thing in MyFolder.SubFolders'复制子文件夹
s=Split(thing,"\")
a=UBound(s)
s3=Split(thing,"\")(a)
response.write thing&"<br>"
response.write s1&"\"&domain&"\"&s3
response.write "<br>"
MyFileObject.copyFolder thing,s1&"\"&domain&"\"&s3
Next
%>
注:aaa为文件夹名,domain为新文件夹名......
asp中去掉html代码(2006-11-01 16:16:00)
摘要:有一段代码如:<a href="/Shop_Cart.asp">购物车</a><img src="/images/Spacer.gif" width="43" height="5">
<a href="/Shop_Banking.asp">收银台</a><img src="/images/Spacer.gif" width="46" height="5">
<a href="/help.asp">服务台</a><img src="/images/Spacer.gif" width="39" height="5">
<a href="/Vip_home.asp">会员中心</a><img src="/images/Spacer.gif" width="2" height="5" border="0">
怎样才能在asp中把其中的HTML标记去掉?只保留其中的文字(购物车,收银台等)?
-----------------------------------------......
图片验证码(2006-10-27 15:23:00)
摘要:<%
Option Explicit
Response.Expires = 0
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-ctrol","no-cache"
Response.ContentType = "Image/BMP"
Randomize Timer
Dim Text_Data(9),Text_Len,Int_Temp(),I,j,k,Int_Temp2
''***** 参数配置区 *****
Text_Len = 4 ''验证码长度(支持1-25位)
''**********************
ReDim Int_Temp( Text_Len - 1 )
Text_Data(0) = "00000000000001111000001100110000110111000011011100001100110000111011000011101100001100110000011110000000000000"
Text_Data(1) = "00000000000000011000000011100000111110000000011000000001100000000110000000011000000001100000000110000000000000"
Text_Data(2) = "00000000000001111000001100110000110011000000001100000001100000001100000001100000001100000000111111000000000000"
Text_Data(3) = "00000000000001111000001100110000110011000000001100000011100000000011000011001100001100110000011110000000000000"
Text_Data(4) = "0000000000000110000000011000000001101100000110110000011011000011001100......
asp+access四级联动(2006-10-26 13:55:00)
摘要:<form name="frm">
<select name=school onchange="MulSelect(1)"></select>
<select name=department onkeypress=sortMe(this) onchange="MulSelect(2)"></select>
<select name=grade onchange="MulSelect(3)"></select>
<select name=student></select>
<p> </p>
</form>
<script>
// 四级联动
var arrSel=["school","department","grade","student"]
arrData=[];
// 从数据库中读出四级联动的数据, 保存到 arrData 数组中(二维数组)
<%
dim conn,rs
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.mappath("test.mdb") & ";Persist Security Info=False"
set rs=conn.execute("select * from dbselect")
do while not rs.eof
%>
arrData[arrData.length]=["<%=trim(rs("school"))%>","<%=trim(rs("department"))%>","<%=trim(rs("grade"))%>","<%=trim(rs("student"))%>"]
<%
rs.movenext
loop
rs.close:set rs=nothing
conn.c......
用asp代码生成access数据库(2006-10-26 08:41:00)
摘要:<%
DBName = "c:\AccessDB.mdb"
if Request.Form("SubmitCreate")<>"" then
'创建数据库
Set mycat = Server.CreateObject( "ADOX.Catalog" )
mycat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBName
if err.number=0 then
Response.Write("<script>alert('数据库创建成功')</script>")
end if
end if
%>
<%
if Request.Form("SubmitCreateTable")<>"" then
'创建数据表
Set conn = Server.CreateObject( "ADODB.Connection" )
conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & DBName
Sql="CREATE TABLE TestTable("&_
"id int IDENTITY (1, 1) NOT NULL ,"&_
"name varchar(255) NOT NULL ,"&_
"pass varchar(255) NULL ,"&_
"logintimes int Default 0&nb......
纯编码实现数据库的建立或压缩!!(2006-10-24 19:01:00)
摘要:
纯编码实现数据库的建立或压缩!!
作者: 萧寒 2001-06-29 14:27
<%
'#######以下是一个类文件,下面的注解是调用类的方法################################################
'# 注意:如果系统不支持建立Scripting.FileSystemObject对象,那么数据库压缩功能将无法使用
'# Access 数据库类
'# CreateDbFile 建立一个Access 数据库文件
'# CompactDatabase 压缩一个Access 数据库文件
'# 建立对象方法:
'# Set a = New DatabaseTools
'# by (萧寒雪) s.f.
'##################################################################################
Class DatabaseTools
Public function CreateDBfile(byVal dbFileName,byVal DbVer,byVal SavePath)
'建立数据库文件
'If DbVer is 0 Then Create Access97 dbFile
'If DbVer is 1 Then Create Access2000 dbFile
On error resume Next
If Right(SavePath,1)<>"\" Or Right(SavePath,1)<>"/" Then SavePath = Trim(SavePath) & "\"
If Left(dbFileName,1)="\" Or Left(dbFileName,1)="/" Then dbFileName ......
常用的javascript验证函数(2006-10-21 21:14:00)
摘要:<script language="javascript">
<!--
//验证是否为空,如果为空返回 false,否则返回 true
function CheckIsNull(Inform,Inputname){
var Form=Inform+"."
eval("Temp="+Form+Inputname+".value;");
if(Temp==""){
alert("提醒您:不能为空");
eval(Form+Inputname+".className='RedInput';");
eval(Form+Inputname+".focus();");
return false;
}else{
eval(Form+Inputname+".className="+Form+Inputname+".className.replace('RedInput','');");
return true;
}
}
//验证是否为数字
function CheckIsNum(Inform,Inputname){
if (!CheckIsNull(Inform,Inputname))return false;
else{
var Form=Inform+"."
eval("Temp="+Form+Inputname+".va......