wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Show div based on if statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Show div based on if statement" Watch "Show div based on if statement" New topic
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: 60739
    
  65

That doesn't look like it will generate valid JS syntax. Do View Source in the browser and see what gets generated.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 60739
    
  65

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.
 
jQuery in Action, 2nd edition
 
subject: Show div based on if statement
 
Similar Threads
how to Get full url with # symbol in servlet?
How to show icons in Tree using DOJO 0.4
How to show a textfield dynamically
How to pass Java Script variable to JSTL
Postfix Operator