|
我的asp学习笔记-Procedures |
Author:咖啡虫 PublishTime:2004-6-15 |
1。Call a procedure using VBScript in ASP
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
You can call a procedure like this:
Result: <%call vbproc(3,4)%>
Or, like this:
Result: <%vbproc 3,4%>
</body>
</html>
结果为:You can call a procedure like this:
Result: 12
Or, like this:
Result: 12
2。Call a procedure using javascript in ASP
<%@ language="javascript" %>
<html>
<head>
<%
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
%>
</head>
<body>
Result: <%jsproc(3,4)%>
</body>
</html>
结果为;Result: 12
3。Call a javascript procedure and a VBScript procedure using VBScript in ASP
<html>
<head>
<%
sub vbproc(num1,num2)
Response.Write(num1*num2)
end sub
%>
<script language="javascript" runat="server">
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
</script>
</head>
<body>
Result: <%call vbproc(3,4)%>
Result: <%call jsproc(3,4)%>
</body>
</html>
结果为:Result: 12
Result: 12
|
| | |