Jump to content


Streaming or Auto-Refreshing?

  • Please log in to reply
1 reply to this topic

#1 EriRyoutan

  • Members
  • PipPip
  • Member
  • 19 posts

Posted 14 April 2006 - 11:53 PM

Hi again.

I'm working on writing a page that keeps getting new content added to it like every few minutes, and i would like it to be either streaming or auto-refreshing. I've heard of it possible with PERL but I'd like to do it using only PHP and/or JavaScript (or HTML, but that's kind of a given)

Thanks for reading, and hope somebody out there has a (simple?) answer.

EDIT: Oh! and does anybody know if $_SESSION[''] $_GET[''] etc, etc. have to be capitalized?

#2 neylitalo

  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 15 April 2006 - 01:00 AM

If you aren't particular about whose browsers you support, you may be able to put the Javascript innerHTML property. I don't think browsers other than Gecko-based or IE support it, though.

Here's a quick & dirty demonstration:
<script language="javascript">
function increaseCounter()
    document.getElementById('testdiv').innerHTML ++;
    setTimeout('increaseCounter();', 1000);
<body onload="increaseCounter();">
<div id="testdiv">1</div>

Load that in your browser, and see if you can make something useful out of the innerHTML property. I'm sure www.w3schools.com has something they can teach you about it.

And you may also want to check out AJAX - Asynchronous Javascript with XML. It's designed specifically for this purpose. Support the creators of this community and go to [a href=\"http://www.ajaxfreaks.com\" target=\"_blank\"]http://www.ajaxfreaks.com[/a] for more info. I'm afraid I've got no experience with that, so I can't help there. :)

http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users