HTML Online Tutorial Contents

Following are the posts for HTML online Tutorial. To learn everything about HTML, just read these posts: HTML Online Tutorial HTML TAGS (2) HTML BASICS (3) HTML ELEMENTS (4) HTML ATTRIBUTES (5) More »

XHTML

XHTML stands for Extensible Hypertext Markup Language. It is also known as XML (Extensible Markup Language). It is a markup language. In XHTML, there are no predefined tags. The user defines the More »

HTML SUMMARY

In this tutorial, you learned: HTML Introduction HTML Tags HTML Basics HTML Elements HTML Attributes HTML Paragraphs HTML Headings HTML Formats HTML Image HTML Links HTML Lists HTML Frames HTML Table After More »

HTML TABLES (13)

HTML Tables are used to arrange data in web pages. HTML allows the use of tables by <table>…</table> tags. Each row in HTML table is recognized by <tr>…</tr> tag. In each row More »

HTML FRAMES (12.2)

Nested frames example: For the following example to work, there are two other simple HTML files : “HMTL11e1 frame a.html” and “HMTL11e1 frame b.html”. your browser will divide your screeub half. The More »

 

Tag Archives: VBScript examples

8 asp

Learn about Basic ASP Procedures (8 ASP):

The JavaScript Procedures can be called by using VBScript in ASP. The ASP source codes can include procedures and functions in it. Following is the example that shows the procedures and functions in ASP source code using VBScript:

Example:

<html>

<head>

<%

Sub vbproc(n1,n)

response.write(n*n1)

end sub

%>

</head>

<body>

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

</body>

</html>

Result:

Result is: 8

 

Following is the example that shows the procedures and functions in ASP source code using JavaScript:

Example:

<%@ language=”JavaScript”%>

<html>

<head>

<%

Function jsproc(n1,n)

{

response.write(n*n1)

}

%>

</head>

<body>

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

</body>

</html>

<script type=”text/javascript”><!–
google_ad_client = “ca-pub-7789281879799866”;
/* webpost */
google_ad_slot = “1930114734”;
google_ad_width = 300;
google_ad_height = 250;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

Result:

Result is: 8

Following is another example which shows how to call JavaScript procedures and VBScript procedures simultaneously in single ASP file:

Example:

<html>

<head>

<%

Sub vbproc(n1,n)

response.write(n*n1)

end sub

%>

<script language=”JavaScript” runat=”server”%>

Function jsproc(n1,n)

{

response.write(n*n1)

}

</script>

</head>

<body>

<p>Result is: <%call jsproc(2,4)%></p>

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

</body>

</html>

 

Result:

Result is: 8

Result is: 8

Some basics about the difference between VBScript and JavaScript:

To call VBScript or JavaScript procedures, you need to use the “call” followed by the procedure name in a ASP file written in VBScript. If you are using the”call” word then you need to use parenthesis for the parameters required by the procedure.  But if you are not using the “call” word then there is no need for parenthesis for parameters. Moreover, if there are no parameters in the procedure then the parenthesis are optional.

It is compulsory to use parenthesis in a ASP file written in JavaScript., when you need to call VBScript or Java

For more visit next posts in this category.To go back to Contents of this tutorial: ASP Active Server Side Scripting Contents