In html.erb, I have 2 functions which establish a session and disconnection session:
<script>
var session = initialize_session()
disconnect_session(session)
function initialize_session() {
session = session_init();
return session;
}
function disconnect_session(session) {
session_end(session);
}
</script>
But the above code errors out. How to get the value from one JavaScript function and pass it to another in JavaScript? Thank you.