javascript - Refresh a PHP page for every predefined seconds -


I want to load / refresh a particular page for every 10 seconds to see the updated data from the database.

I used Meta to do this

  & lt; Meta HTTP-EQUIV = Refresh CONTENT = '10; URL = livedata.php '& gt;  

But still I believe that we also do this by using:

  • To load a div from the set time Javascript for
  • Ajax dynamic refresh

If you perform performance problems using Meta, AJAX dynamic refreshing, JavaScript set timeout .. Even if you share it will be good.

Note: The entire page needs to be refreshed instead of a specific frame or div.

>

The use of AJX for the user is less intuitive, as the user does not see that it is refreshing / reloading until it is complete.

Please note that AJAX may perform better or poorly based on status Meta:

  • If the data should be updated, the data is small in relation to the full HTML page size , Then AJAX is better than Meta, because with AJAX you can only send data differences, and / or you can send data in HTML more compact format.
  • The Java execution script puts a burden in the user's browser, if the user has 20 tabs open (which is not uncommon), and each of them runs a set timeout in the background, then all of this browser Javascript can make a huge difference to change the refresh in profits.

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -