Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ASP on pages with .htm extension

ASP 101

Using ASP on pages with .htm extension

by  XL5  Posted    (Edited  )
By using the Javascript "src=" tag Javascript can be created dynamically and asp executed on an html page.

Example
On the HTML page

<script Language="Javascript" src="test.asp"></script>

<script Language="Javascript">
alert('First Name = '+fname);
alert('Second Name = '+sname);
</script>

The test.asp page

<%
' Get something from a database using asp
Set oConn = Server.CreateObject("ADODB.Connection")
....

' Now add the results to the HTML page
Response.Write "var fname=" & oRsf.Fields("FName") & ";"
Response.Write "var sname=" & oRsf.Fields("SName") & ";"
%>

Steve
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top