newbie: how to use global ASP variable in jscript?

  • Thread starter Bart Plessers \(artabel\)
  • Start date
B

Bart Plessers \(artabel\)

Hello,

I want to have my function in jscript make use of the variables in an
asp-page.
How can I read the contents of a variable in the function (I don't want to
pass them as an argument)

tia

bartp
 
R

Ray at

<%@ Language="JScript" %>
<%

var x=3;
writeTheVar();

function writeTheVar()
{
Response.write(x)
}
%>

Ray at work
 
T

Tom B

Do you mean on the client?

In vbscript you'd do something like......


<%
Dim someValue

someValue="XXXXX"

%>

<SCRIPT LANGUAGE=Javascript>
function aFunction()
{
alert('<%=someValue%>');
}
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top