aspose file tools*
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
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: 60992
    
  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: 60992
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Show div based on if statement