Jump to content

Streaming or Auto-Refreshing?


EriRyoutan

Recommended Posts

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?
Link to comment
Share on other sites

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:
[code]<html>
<head>
<script language="javascript">
function increaseCounter()
{
    document.getElementById('testdiv').innerHTML ++;
    setTimeout('increaseCounter();', 1000);
}
</script>
</head>
<body onload="increaseCounter();">
<div id="testdiv">1</div>
</body>
</html>[/code]

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. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.