I can easily set a javascript variable with a mydbr variable's value, but what is the syntax for the reverse, especially in an if else statement. The below works fine to set a javascript variable, but I can't seem to work out the correct syntax to do the reverse
<script type="text/javascript">
if (sessionStorage.length == 0)
{
sessionStorage.tmpdb = "' + @tableid + '";
}
</script>
Ideally I would like to add an else statement that populates @tableid with the value of sessionStorage.tmpdb if sessionStorage.tmpdb has already been set.
I have a work around in place if it isn't possible (I can just pass @tableid as part of the sequence of stored procedure calls, so this is more for future reference than to solve an immediate problem.
Thanks