troubleshooting Question

How can I use a javascript variable in jsp code

Avatar of hung2003
hung2003 asked on
5 Comments1 Solution2149 ViewsLast Modified:
here is my situation,

I have a javascript function at the very beginning of my jsp
for example,

var TT = 'false';
function set_flag(flag_value){
   TT = flag_value;

Now, in my jsp (same file) I need to do a condition to decide which message I'm going to show on the browser, and the condition is depend on the value of variable TT. E.g.

if (TT == 'true'){
<tr><td>TT is true
<tr><td>TT is false

How can I use the javascript variable TT in my jsp code? Thank you! pretty urgent.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros