Overview of ASP judgment functions and common tips for creating web pages

Source: Internet
Author: User

 

<1> isarray Function
Returns a Boolean value to indicate whether a variable is an array.

Syntax
Isarray (varname)
The varname parameter can be any variable.

Description
If the variable is an array, the isarray function returns true; otherwise, the function returns false. When the variable contains an array, the isarray function is very effective.

<2> isdate Function
Returns a Boolean value to indicate whether an expression can be converted to a date.

Syntax
Isdate (expression)
The expression parameter can be any date expression or string expression that can be recognized as a date or time.

Description
If the expression is a date or can be legally converted to a valid date, the isdate function returns true; otherwise, the function returns false. In Microsoft Windows, the valid date range is from January 1, 100 AD to December 31, 9999 AD. valid date ranges vary with the operating system.

<3> isempty Function
Return a Boolean value to indicate whether the variable has been initialized.

Syntax
Isempty (expression)
The expression parameter can be any expression. However, because isempty is used to determine whether a variable has been initialized, the expression parameter is often a variable name.

Description
If the variable is not initialized or explicitly set to empty, the isempty function returns true; otherwise, the function returns false. If expression contains more than one variable, false is always returned.

<4> isnull Function
Returns a Boolean value indicating whether the expression does not contain any valid data (null ).

Syntax
Isnull (expression)
The expression parameter can be any expression.

Description
If expression is null, isnull returns true, that is, the expression does not contain valid data. Otherwise, isnull returns false. If expression is composed of multiple variables, null in any component variable of the expression returns true for the entire expression.
Null indicates that the variable does not contain valid data. Null is different from empty, which indicates that the variable is not initialized. Null is also different from a zero-length string (""). A zero-length string usually refers to an empty string.

The isnull function can be used to determine whether the expression contains a null value. In some cases, you want to set the expression value to true, for example, ifvar = NULL and ifvar <> null, but they are always false. This is because any expression containing null itself is null, so the result of the expression is false.

<5> isnumeric Function
Returns a Boolean value to indicate whether the expression value is a number.

Syntax
Isnumeric (expression)
The expression parameter can be any expression.

Description
If the entire expression is recognized as a number, the isnumeric function returns true; otherwise, the function returns false.
If expression is a date expression, the isnumeric function returns false.

<6> isobject Functions
Returns a Boolean value indicating whether the expression references a valid Automation Object.

Syntax
Isobject (expression)
The expression parameter can be any expression.

Description
If expression is an object sub-type variable or a custom object, isobject returns true; otherwise, the function returns false.

Asp web page creation skills

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 = "& #106 avascript">

<! --

<! -- Change the file path -->

* ********** ('HTTP: // www. ******. 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"> hhhhhhhhhhhhhhhhh </marquee>

8. automatically close the webpage:
<Script language = "& #106 avascript">

<! --

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 is 60.

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)

Cursec = parselimit % 60

If (curmin! = 0)

Curtime = curmin + "Minute" + cursec + "second to refresh this page! "

Else

Curtime = cursec + "refresh this page in seconds! "

Window. Status = curtime

SetTimeout ("Maid ()", 1000)

}

}
Window. onload = beginrefresh

File & #58 // -->

</SCRIPT>

// Enable the page to be automatically closed in five seconds
<SCRIPT>

SetTimeout ("window. Close ()", 5000 );

</SCRIPT>

 

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.