javascript 实用代码1
按钮超级连接
<input type="button" name="Submit" onclick="location.href='#'" value="按钮" />
<input type="button" name="Submit" onclick="location.href='http://downs.lxun.com'" value="按钮" />
<input type="radio" onclick="window.open('/getball/ssqzn.html','','');" id="type" name="type" value="0" >
<input type="radio" onclick="window.open('/getball/ssqjx.html','','');" id="type" name="type" value="1" >
<input type="radio" onClick="javascript:ChangeType();" id="type" name="type" value="2" checked >
<a href="javascript :history.back(-1)">返回上一页</a>
或
<a href="javascript :;" onClick="javascript :history.back(-1);">返回上一页</a>
如果是用按钮做的话就是:
<input type="button" name="Submit" onclick="javascript:history.back(-1);" value="返回上一页">
用图片做的话就是:
<img src="图片路径" border="0" onclick="javascript:history.back(-1);" title="返回上一页">
<%
' 弹出对话框
'*******************************************************************
Sub alert(message)
message = replace(message,"'","\'")
Response.Write ("<script>alert('" & message & "')</script>")
End Sub
'*******************************************************************
' 返回上一页,一般用在判断信息提交是否完全之后
'*******************************************************************
Sub GoBack()
Response.write ("<script>history.go(-1)</script>")
End Sub
'*******************************************************************
' 重定向另外的连接
'*******************************************************************
Sub Go(url)
Response.write ("<script>location.href('" & url & "')</script>")
End Sub
指定秒数重定向另外的连接
'*******************************************************************
sub GoPage(url,s)
s=s*1000
Response.Write "<SCRIPT LANGUAGE=JavaScript>"
Response.Write "window.setTimeout("&chr(34)&"window.navigate('"&url&"')"&chr(34)&","&s&")"
Response.Write "</script>"
end sub
alert("你好,请重新登陆!")
%>