| Author |
Show div based on if statement
|
Thomas Byrne
Greenhorn
Joined: Aug 21, 2012
Posts: 16
|
|
Hi fellows,
I'm trying to use the following code to show a div based on the value returned by servlet (${message.errorID}). I can't get this to work and wonder if there is an other/better way?
Cheers,
Thomas
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
That doesn't look like it will generate valid JS syntax. Do View Source in the browser and see what gets generated.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Thomas Byrne
Greenhorn
Joined: Aug 21, 2012
Posts: 16
|
|
Thank you for remind me that we have something like source viewer in the browser. The key issue were missing quotations mark around ${message.errorID}.
So, working code looks like:
Cheers,
Thomas
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
There are lots of tools in the modern browsers that can help diagnose these types of problems. In addition to View Source, all modern browsers except Firefox have built-in debuggers. For Firefox, there's the Firebug plugin.
|
 |
 |
|
|
subject: Show div based on if statement
|
|
|