Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Show div based on if statement

 
Thomas Byrne
Greenhorn
Posts: 16
Mac OS X Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That doesn't look like it will generate valid JS syntax. Do View Source in the browser and see what gets generated.
 
Thomas Byrne
Greenhorn
Posts: 16
Mac OS X Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic