PDA

Click to See Complete Forum and Search --> : using ASP inside of javascript??


pnj
Jan 4th, 2001, 05:34 PM
hello,
I have an ASP page that has some DHTML/javascript inside it.
the javascript shows and hides a layer that has text on it.

what I need to do is pull the text from my application variable but the problem is, becouse I have <script> tags for the javascript when I try and use <%=application("whatever")%> it fails.

does this make sense? let me know if you need more discription.
thank you

Ianpbaker
Jan 5th, 2001, 02:45 AM
Hi pnj

i've been doing a lot of this latley and it works fine. If your using interdev as your development tool, it doesn't reconize the asp, but it still works fine on the server.

simple example


<html>
<head>
<script language="javascript">
function hello()
{
alert('<%="hello"%>');
}
</script>
</head>
<body>
<input type="button" onclick="hello();" value="Simple asp in script tags test">
</body>
</html>


Hope this helps

Ian

pnj
Jan 5th, 2001, 11:46 AM
that is strange couse I couldn't get it to work.
I tryed it and got nothing, BUT I did get it to work by using a form like this....
<form name=Myform>
<input type=hidden name=hidNorth value=<%=application("north")%>
</form>

<script>
var theVariable=document.Myform.hidNorth.value
</script>

this works great.
thanks

Ianpbaker
Jan 8th, 2001, 02:37 AM
Hi again pnj

are you trying this out on pws, because if I remember correctly pws doesn't handle it but IIS does

Ian

Skeen
Jan 8th, 2001, 04:19 AM
I'm running pws on '98 at home and NT$ workstation at work, and IIS won't run on NT workstation, only server, will IIS run on '98?

Cheers n beers skeen

Ianpbaker
Jan 8th, 2001, 07:34 AM
Hi skeen

IIS4 and pws use exactly the same engine but pws limits you to what you can do. If you install the option pack onto workstation, it gives you the choice to install the MMC interface as well, but pws on 98 doesn't give you the choice.

hope this helps

Ian