WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP Procedures


In ASP you can call a JavaScript method from a VBScript and the other way around.


Procedures

The ASP source code can contain strategies and capacities:

Example

<!DOCTYPE html>
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>

<p>Result: <%call vbproc(3,4)%></p>

</body>
</html>

Insert the <%@ language="language" %> line over the <html> tag to compose the technique/work in another scripting language:

Example

<%@ language="javascript" %>
<!DOCTYPE html>
<html>
<head>
<%
work jsproc(num1,num2)
{
Response.Write(num1*num2)
}
%>
</head>
<body>

<p>Result: <%jsproc(3,4)%></p>

</body>
</html>

Differences Between VBScript and JavaScript

When calling a VBScript or a JavaScript strategy from an ASP document written in VBScript, you can utilize the "call" watchword pursued by the system name. On the off chance that a methodology requires parameters, the parameter list must be encased in enclosures when utilizing the "call" catchphrase. On the off chance that you discard the "call" catchphrase, the parameter list must not be encased in brackets. On the off chance that the system has no parameters, the brackets are optional.

When calling a JavaScript or a VBScript technique from an ASP record written in JavaScript, continuously use brackets after the method name.