Please visit our sponsors !
ASP Procedures
In ASP you can call a JavaScript procedure from a VBScript and vice versa.
Examples
Call a procedure using VBScript
How to call a VBScript procedure from ASP.
Call a procedure using JavaScript
How to call a JavaScript procedure from ASP.
Call procedures using VBScript
How to call a JavaScript procedure and a VBScript procedure from ASP.
Procedures
ASP code can contain procedures and functions:
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
The result of the calculation is: <%call vbproc(3,4)%>
</body>
</html>
|
Insert the <%@ language="language" %> line above the
<html> tag if you want to write procedures or functions in a scripting language
other than the
default:
<%@ language="javascript" %>
<html>
<head>
<%
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
%>
</head>
<body>
The result of the calculation is: <%jsproc(3,4)%>
</body>
</html>
|
Calling a Procedure
When calling a VBScript or a JavaScript procedure from an ASP page written in VBScript, you can use the
"call" keyword followed by the procedure name. If
a procedure requires
parameters, the parameter list must be enclosed in parentheses when using the
"call" keyword. If you omit the "call" keyword, the
parameter list must not be enclosed in parentheses. If the procedure has no
parameters, the parentheses are optional.
When calling a JavaScript or a VBScript procedure from an ASP page written in
JavaScript,
always use parentheses after the procedure name.
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|