Some ASP code commonly used by beginners

Source: Internet
Author: User
1. Obtain the system time:
<% = Now () %>
2. Obtain the IP address used for access:
<% = Request. serverVariables ("remote_host") %>
3. Obtain the system and browser version:
<Script>
Window.doc ument. write ("version:" + navigator. appName + navigator. appVersion + "browser .")
</Script>
4. Remove IE hybrid bars:
<Body scroll = "no">
<Body style = "overflow-y: hidden">
5. Enter the website and jump out of the advertisement:
<Script language = "javascript">
<! --
<! -- Change the file path -->
Window. open ('http: // www.XXXXXX.com ', '', 'height = 200, width = 300, top = 0, left = 30 ');
// -->
</Script>
6. Random number:
<% Randomize %>
<% = (Int (rnd () * n) + 1) %>
N is a changeable variable.
7. Upstream mixed code:
<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. Automatically close the webpage:
<Script LANGUAGE = "javascript">
<! --
SetTimeout ('window. close (); ', 10000); // close after 60 seconds
// -->
</Script>
<P align = "center"> This page is automatically closed 10 seconds later. Please refresh the page. </p>
9. Random background music:
<% Randomize %>
<Bgsound src = "mids/<% = (int (rnd () * 60) + 1) %>. mid" loop = "-1">
You can modify the number to limit the number of calls. Here are 60 calls.
10. Automatically refresh this page:
<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)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.