File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

refresh an HTML table using AJAX and JSP

 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • 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,
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Explore window.setInterval()
 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64204
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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;
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic