Easy Tutorial
❮ Asp Ref Session Asp Adrotator ❯

ASP Subroutine


In ASP, you can call JavaScript subroutines from VBScript and vice versa.


Subroutine

ASP source code can include subroutines and functions:

Example

By writing the line <%@ language="language " %> above the <html> tag, you can use another scripting language to write subroutines or functions:

Example


Differences between VBScript and JavaScript

When calling VBScript or JavaScript subroutines from an ASP file written in VBScript, you can use the "call" keyword followed by the subroutine name. If the subroutine requires parameters, they must be enclosed in parentheses when using the "call" keyword. If you omit the "call" keyword, the parameters do not need to be enclosed in parentheses. If the subroutine has no parameters, the parentheses are optional.

When calling VBScript or JavaScript subroutines from an ASP file written in JavaScript, you must use parentheses after the subroutine name.


More Examples

Calling Subroutines with VBScript

❮ Asp Ref Session Asp Adrotator ❯