Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jquery script not executing on the data values that are extracted from the database

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




script.js code



Odd tables are not coloured in this scenario


There are 3 entities created in a table and all the 3 entities are displayed in web application too.But all the three entities are shown in a different line also I have used hide script using the id attribute of the table then also only one row is hiding ,rest of the rows are visible


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Showing JSP source here is not helpful. This is not the JSP forum and the JSP source is not what the browser sees. The browser sees the response generated from the JSP.

And you're still putting Java code in JSPs? In 2012?
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Showing JSP source here is not helpful. This is not the JSP forum and the JSP source is not what the browser sees. The browser sees the response generated from the JSP.

And you're still putting Java code in JSPs? In 2012?


Hi Bear,

I am a Novice in JSP so doing it the old way... just for practise once i understand JSTL Tags I will definetly try it out, but the issue right now is the .js code that i defined that odd row tables should be this color is not working(as its a dynamic tables created when values are received from database tables)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote:I am a Novice in JSP so doing it the old way... just for practice once

This is foolish. If you are a novice to JSP it's even more important to learn to do things the right way and not learn bad habits at the outset that you'll just need to unlearn later.

but the issue right now is the .js code that i defined that odd row tables should be this color is not working

What have you done to debug this? You've posted too much code for me to wade through. Are you sure that the elements exist before you are trying to reference them?

It'd be best to post an SSCCE that shows the problem.
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The above code snippet is working fine

And below is the other code js script:
$('#celebs tr: odd').
css('background-color', '#dddddd');
$('#celebs tr: odd').
css('color', '#666666')
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue resolved </table> was in while loop itself hence the issue :P
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic