This is written in a JScipt code block (the third block on the page). It has this string ("This string is a variable in a external js file.") imported from an external js file as the second code block.

Example of mixing languages in ASP on IIS

This is an HTML paragraph before any code blocks.

This is an HTML paragraph after all code blocks.

This is the code:

<html>
	<head>
		<title>Example of mixing languages in ASP on IIS</title>
		<style>
			p {color:purple}
			.vbs {color:blue}
			.js {color:green}
			.perl {color:red}
		</style>
	</head>
	<body>
		<p>This is an HTML paragraph before any code blocks.</p>

		<script language="VBScript" runat="server">
			response.write "<p class='vbs'>This is written in a VBScript code block (the first block on the page).</p>"
	
			function a
				a = "<span class='vbs'>VBScript function, </span>" & c
			end function
	
			response.write "<span class='vbs'>What follows is the result of code in this VBscript code block calling a JScript function calling a VBScript function calling a PerlScript function: </span>" & b()
		</script>

		<script language="JScript" runat="server" src="combineScripts.js"></script>

		<script language="JScript" runat="server">
			Response.write("<p class='js'>This is written in a JScipt code block (the third block on the page). It has this string (" + strExample + ") imported from an external js file as the second code block.</p>");
	
			function b() {
				return '<span class="js">JScript function, </span>' + a();
			}
		</script>

		<script language="PerlScript" runat="server">
			$Response->Write('<p class="perl">This is written in a Perlscript code block (the third and last block on the page).</perl>');
			$Response->Write('<p class="perl">PerlScripts syntax will not allow it to call other languages.</perl>');
	
			sub c() {
				return '<span class="perl">PerlScript function.</span>';
			}
		</script>

		<script src="combineScripts.js"></script>
		<script>
			alert(strExample);
		</script>

		<p>
			This is an HTML paragraph after all code blocks.
		</p>

		<pre>
			Code listing is here (no need to get all regressive by repeating it again)
		</pre>
	</body>
</html>
		

This is written in a VBScript code block (the first block on the page).

What follows is the result of code in this VBscript code block calling a JScript function calling a VBScript function calling a PerlScript function: JScript function, VBScript function,