整理了一些ASP初學者常用的代碼

來源:互聯網
上載者:User
1.獲得系統時間:
<%=now()%>
2.取得來訪用的IP:
<%=request.serverVariables("remote_host")%>
3.獲得系統,瀏覽器版本:
<script>
window.document.write("版本:"+navigator.appName+navigator.appVersion+" browser.")
</script>
4.去除IE混動條:
<body scroll="no">
<body style="overflow-y:hidden">
5.進入網站,跳出廣告:
<script language="javascript">
<!--
<!-- 注意變更檔所在路徑-->
window.open(''http://www.XXXXXX.com&#39;','''',''height=200,width=300,top=0,left=30'');
// -->
</script>
6.隨機數:
<%randomize%>
<%=(int(rnd()*n)+1)%>
N為可改變數
7.向上混動代碼:
<marquee direction="up" scrolldelay="200" style="font-size: 9pt; color: #FF0000; line-height: 150%; font-style:italic; font-weight:bold" scrollamount="2" width="206" height="207" bgcolor="#FFFF00">hhhhhhhhhhhhhhhhhhh</marquee>
8.自動關閉網頁:
<script LANGUAGE="javascript">
<!--
setTimeout(''window.close();'', 10000); //60秒後關閉
// -->
</script>
<p align="center">本頁10秒後自動關閉,請注意重新整理頁面</p>
9.隨機背景音樂:
<%randomize%>
<bgsound src="mids/<%=(int(rnd()*60)+1)%>.mid" loop="-1"> 
可以修改數字,限制調用個數,我這裡是60個.
10.自動重新整理本頁面:
<script>
<!--  
var limit="0:10"  
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.