• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to call java script function in JSP (Struts 2)

 
hildich kilal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved Please ignore
 
Hans Egger
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are talking about the function showMessage(), right?

You need to provide the relevant .js-files, otherwise it's hard to say why it doesn't work.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Firebug to debug your JavaScript code, or just put some alert(...) statements in the selectAll(...) function to help track down what you've done wrong.

I'd strongly recommend using a JavaScript library like jQuery, Prototype, etc. to help clean up the JavaScript.

I really hope you clean up the JSP, too--that's extremely difficult to read and hard to maintain. Mixing Java and JSP like this, in this quantity, is a recipe for disaster.

There's no reason to use <s:a...> tags if you're not using them for the Ajax theme. If you're not using the Ajax theme, there's no reason to use <s:head theme="ajax"/>, and it will add a *significant* amount of overhead to your page loading since it loads Dojo.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic