How to update parts of the site without reloading javascript

Asked

Viewed 37 times

0

Well my question is the following, my page receives information from the database, such as temperature. I wanted to know how to do, so that if I changed in my database the remperatura, my page also changed without having to update the page (refresh or F5).

That is, if I change a small part of the text of the site, the site does not need to update so that the new temperature may appear.

  • The other topic has nothing to do with my question.

  • The other topic mentions the use of AJAX, which you can use to get the result you want on your site.

  • After reading your question, what came to mind is: "AJAX", just like fellow @lazyFox said. I agree it’s a totally different question, but look at Sergio’s answer.

  • Take a look at Server Sent Events.. When changing the temperature in the Database the server warns customers that it has changed... Then just change the site by javascript.

  • 1

    Surely this question has already been asked several times, and the simplest answer is "AJAX". However, I believe that the question that has been marked as duplicate does not properly explain the problem of this one. There are shown ways to modify the behavior of a link to use AJAX, which is not the problem of this question.

  • 1

    Show some of your code Gonçalo

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.