# Dynamicly reloading a page

**URL:** https://forum.kirupa.com/t/dynamicly-reloading-a-page/291407
**Category:** programming
**Created:** [June 29, 2009, 12:53pm UTC](https://forum.kirupa.com/t/dynamicly-reloading-a-page/291407 "2009-06-29T12:53:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Nevo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nevo/32/3473_2.png) [@Nevo](https://forum.kirupa.com/u/Nevo)
#### Post date: [June 29, 2009, 12:53pm UTC](https://forum.kirupa.com/t/dynamicly-reloading-a-page/291407/1 "2009-06-29T12:53:25Z")

</div>

Hi again,

**Basics**  
I’ve made a interface where the end user can enter/change a lot of information then submit this, this is all ajax and not a lot of the interface’s layout will ever change, jsut certain div’s attributes.

After submitting it I’ve greyed the background out and added a box displaying that the page will be updated after certain changes in the database have been verified and made.

**Need to do**  
The way I intend to do this is set a simple javascript timer up every 30 seconds which will asynchronously pass a PHP and return a json object. This will indicate how the update is going (say a percentage or stage I’ve not decided yet), it will return complete after the update is made and a javascript function will be executed.

I hope that was clear!  
So my real question is; is that the best way to go about it or and I coming at the problem form the wrong approach?

Would it be easier to have… say a hidded iFrame which will intern refresh every 30 seconds… but then I hate iFrames. the page is dependent on javascript being on the clients machine so using javascript isn’t a problem.

Or is there some special technique someone can guide me in the direction of? Sockets?

Thanks greatly in advance!  
Oli
