How to make page title, auto refresh every x seconds (using

  • basketmen
  • Student
  • Student
  • basketmen
  • Posts: 68

Post 3+ Months Ago

I have a php file lets say file1.php, that printing a variable, its dynamic numbers output that already always increasing, like private message numbers that coming or others :

PHP Code: [ Select ]
<?php
echo $variable
?>
 
  1. <?php
  2. echo $variable
  3. ?>
  4.  




i want to put that variable output, in another files page title, lets say file2.php or file3.html,
in the front of the another files page titles, and auto refresh every x seconds, maybe like this :

Quote:
(1) - another text in the page title


after x seconds, get a private message
Quote:
(2) - another text in the page title


after another x seconds, get another private message
Quote:
(3) - another text in the page title






or its ok if just like this, only the variable, without the another text in the page title
Quote:
(1)






please share your knowledge to make it, maybe using javascript, jquery or others
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Satwant
  • Graduate
  • Graduate
  • User avatar
  • Posts: 127
  • Loc: Bangalore

Post 3+ Months Ago

From file3.html u need to make a AJAX call to your server and retrieve $variable value. After just update

window.title property to update the window title.

Create a function for Ajax call and change title and put it in setTimeout to repeat the process after x seconds.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 77 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.