|
-
Nov 4th, 2002, 06:54 AM
#1
Thread Starter
Lively Member
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
-
Nov 4th, 2002, 08:57 AM
#2
Stuck in the 80s
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.
-
Nov 5th, 2002, 08:26 AM
#3
To exchange values between javascript and asp, you'll have to write a cookie.
-
Nov 5th, 2002, 09:23 AM
#4
Thread Starter
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|