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
Printable View
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
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:
If you don't know an ASP equivalent for that, check with the chaps on the ASP board.Code:<?php
echo '<script type="text/javascript">
var sessionID = "' . $_SESSION['id'] . '";
</script>';
?>
To exchange values between javascript and asp, you'll have to write a cookie.
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