user782104
user782104

Reputation: 13555

Dynamic change the tab content

enter image description here

I would like to know how to retrieve some new activity like the stackoverflow example? for example, if someone insert into the database, i can reflect it on the other user .

Also, if i want to dynamic change the tab content , such as when there is 1 new activity it is (1) title, i can simply using <title> <? echo $new; ?> title</title>?

Thank you.

Upvotes: 2

Views: 349

Answers (1)

Husain Basrawala
Husain Basrawala

Reputation: 1751

One way is to send Ajax request to poll periodically for any changes. The server side call will check for any new activities and send appropriate response such as number of activities. You can handle the response and update the title.

$.ajax({
  url: "get_update.php",      
  success: function(data){
    $(title).html(data); // data = "2 new activities"
  }
});

Upvotes: 1

Related Questions