• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

display table with ajax in html from db using servlet

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody! I am working in my thesis for my degree and i am doing a java web application. i want to display a table from database in html with servlet without refreshing the page when i am clicking on a tab. Could you please tell me what is wrong with my code or what should I do?  I would appreciate any help.


html file:






servlet file:

 
Rancher
Posts: 1946
15
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what's happening now?
 
efi sopasi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't change nothing in the content when i click the link but when i do it as redirect it display the table. i want to display it in the html page and not to redirect or refresh page
 
Rancher
Posts: 4115
47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried debugging the javascript and seeing what has been returned from the call?
Also, look at whether anything has been added to the structure of the page.
You'll need to use your browser's developer tools for this (F12).
 
Sheriff
Posts: 67266
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is the ready handler declaration of line 13 inside a function?        
 
efi sopasi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Why is the ready handler declaration of line 13 inside a function?        



it should be outside fetch function?
 
efi sopasi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

efi sopasi wrote:

Bear Bibeault wrote:Why is the ready handler declaration of line 13 inside a function?        



it should be outside fetch function?



it doesn't change nothing
 
Bear Bibeault
Sheriff
Posts: 67266
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

efi sopasi wrote:it doesn't change nothing


That's irrelevant. The purpose of the ready handler is to trigger its handler function when the DOM is ready. It should be performed at top level. Declaring it inside a function is nonsense.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!