ASP中子程序的应用
发布时间:2023-09-19 10:27:02 所属栏目:Asp教程 来源:
导读:如何从ASP调用以VBScript编写的子程序。
以下为引用的内容:
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
<p>
You can call a procedure like th
以下为引用的内容:
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
<p>
You can call a procedure like th
如何从ASP调用以VBScript编写的子程序。 以下为引用的内容: <html> <head> <% sub vbproc(num1,num2) response.write(num1*num2) end sub %> </head> <body> <p> You can call a procedure like this: </p> <p> Result: <l vbproc(3,4)%> </p> <p> Or, like this: </p> <p> Result: <%vbproc 3,4%> </p> </body> </html> 调用使用JavaScript的子程序 如何从ASP调用以JavaScript编写的子程序。 <%@ language="javascript" %> <html> <head> <% function jsproc(num1,num2) { Response.Write(num1*num2) } %> </head> <body> <p> Result: <%jsproc(3,4)%> </p> </body> </html> 调用使用VBScript和JavaScript的子程序 如何在一个ASP文件中调用以VBScript和JavaScript编写的子程序。 <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> <p>Result: <l vbproc(3,4)%></p> <p>Result: <l jsproc(3,4)%></p> </body> </html> 子程序 ASP源代码可包含子程序和函数: <html> <head> <% sub vbproc(num1,num2) response.write(num1*num2) end sub %> </head> <body> <p>Result: <l vbproc(3,4)%></p> </body> </html> 将<%@ language="language" %>这一行写到<html>标签的上面,就可以使用另外一种脚本语言来编写子程序或者函数: <%@ language="javascript" %> <html> <head> <% function jsproc(num1,num2) { Response.Write(num1*num2) } %> </head> <body> <p>Result: <%jsproc(3,4)%></p> </body> </html> (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐