• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

refresh an HTML table using AJAX and JSP

 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello everybody;
I hope everything is going well for everyone

I am working on a project and I am stuck since quite a long ago on how to refresh some database tables I have using Ajax.

The ideal would be to refresh them automatically every for example 30 seconds, but for now I have a submit button to trigger the update.

Thank you soo much for any help you might give me.
Best regards,
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Explore window.setInterval()
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for you fast reply.
Now I got that to be working but when I click refresh, it always moves the page to the top

how can I get rid of that ?

thank you.
regards,
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by aymane chetibi:
it always moves the page to the top


I do not know what you mean by this.
 
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean the Refresh button, the browser's provide (F5 thing). As the page is not refreshed back, forward, refresh etc. might not work the way you intend them to work. I guess there are some toolkits that might help you on some counts but atleast I can't remember any.

Out of curiosity I would like to know why do you want to press the Refresh button, in case if that's what we are talking about(Browser provided refresh button).
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sooo sorry, I used the wrong word.
I do not mean to use the browser's refresh button.
I meant that when the Javascript code refreshes the part it is supposed to refresh ( <DIV> ), the page is moved back to the top and the user should scroll down again to see the modifications.

I have another question, in case I want to use a servlet to update information on my View, what is the url I am supposed to use in the Javascript code ?

I used the following code and it does not seem to work:

I hope somebody can help me through with this, I hardly can find any AJAX related code on the internet.

Thank you soo much.
Best regards;
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic