Results 1 to 4 of 4

Thread: asp and javascript

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    117

    asp and javascript

    hi


    i have somthing that i wrote in asp and i put a value to a session


    now i want to load this value using javascript



    i hope i am clear
    thank you
    sharon

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    JavaScript can't read session variables as they are stored on the server side and JavaScript is handled on the client side.

    However, when you create the page with the JavaScript in it, just use ASP (if that's what you're using to create the page) to pass the variable to an JavaScript variable.

    I don't know ASP, so I can't give you any code, but in PHP it would be something like:

    Code:
    <?php
        echo '<script type="text/javascript">
            var sessionID = "' . $_SESSION['id'] . '";
        </script>';
    ?>
    If you don't know an ASP equivalent for that, check with the chaps on the ASP board.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    To exchange values between javascript and asp, you'll have to write a cookie.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2000
    Posts
    117
    hi


    i place my question in asp forum and they solve it by useing hidden inputbox and call its value by document.getelementid("sessinid") in javascript


    bye and thank you
    thank you
    sharon

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