Since Javascript is client-side, and ASP pages are created server-side, you have to be creative in how the two scripts interact. For example, to get data from a database or datafile into Javascript, the .ASP page will need to write out the information into a Javascript function. For example, here I am loading database information that has been put into a VBScript array called VBArray into two Javascript arrays named Arch and ArchV. You might notice the mixture of <% and %> which shows where the VBScript starts and stops and the Javascript begins.
//load Archived Course Array
var Arch = new Array();
var ArchV = new Array();
<% if Arch(0,0) <> "" then%>
var Arch = new Array(<%=ubound(VBArray,2)%>);
var ArchV = new Array(<%=ubound(VBArray,2)%>);
<%
For i = 0 to ubound(Arch,2)
%>
Arch[<%=i%>] = "<%=VBArray(1,i)%>";
ArchV[<%=i%>] = "<%=VBArray(0,i)%>";
<%
Next
End if
%>
Because response, request, etc. are dealt with at the server level, you can't manipulate those commands using Javascript. However, once you get the page create as you want it, you can let Javascript take over from there and redirect using Javascript based on user action on that page.
Using Javascript, we are dynamically building the URL to direct the page to pulling in values iUGID and ref_URL from the form on the page:
var URL = "";
URL = "javadirect.asp?ref_URL="+escape(ref_URL)+"iUGID="+iUGID;
//now sending the page to the URL location
self.location = URL;
Hope that helps,
Joli