Results 1 to 6 of 6

Thread: using ASP inside of javascript??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    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
    pnj

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    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

    Code:
    <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
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    It didn't work for me??

    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
    pnj

  4. #4
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi again pnj

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

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  5. #5
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Thumbs up

    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
    "It wasn't the booze that made me snooze, It was the Gin that did me in!"

  6. #6
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    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
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width