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

  • basketmen
  • Student
  • Student
  • No Avatar
  • Joined: Mar 21, 2007
  • Posts: 66
  • Status: Offline

Post May 7th, 2012, 12:04 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 7th, 2012, 12:04 am

  • Satwant
  • Graduate
  • Graduate
  • User avatar
  • Joined: Dec 27, 2010
  • Posts: 126
  • Loc: Bangalore
  • Status: Offline

Post May 11th, 2012, 10:58 pm

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.
Thank You
Satwant Singh Hundal
http://www.mrhundal.com

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 127 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.