Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 706631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:11:16+00:00 2026-05-14T04:11:16+00:00

HTML5 draft contains an API called EventSource to stream data (notifications) trough javascript using

  • 0

HTML5 draft contains an API called EventSource to stream data (notifications) trough javascript using only one server call.

Looking it up, I found an exemple on Opera Labs of the javascript part :

document.getElementsByTagName("event-source")[0]
        .addEventListener("server-time", eventHandler, false);

function eventHandler(event)
{
    // Alert time sent by the server
    alert(event.data); 
}

and the server side part :

<?php
header("Content-Type: application/x-dom-event-stream");
while(true) {
    echo "Event: server-time\n";
    $time = time();
    echo "data: $time\n";
    echo "\n";
    flush();
    sleep(3);
}
?>

But as of today, it seems only Opera has implemented the API, neither Chrome nor Safari have a working version (Am I wrong here ?)

So my question is, is there any other way in javascript, maybe more complex, to use this one stream to get data ?

EDIT : I’m looking at Comet stuff right now, but I’m not sure how to reuse that 🙂
EDIT 2 : Apparentry, “x-dom-event-stream” has now been renamed “text/event-stream”
EDIT 3 : Got to understand way more of it with this recent article from javanet

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:11:17+00:00Added an answer on May 14, 2026 at 4:11 am

    See Orbited, which provides a javascript library and the server. The javascript library tries to use WebSockets and falls back to long-polling or other methods.

    Here’s a good guide: http://thingsilearned.com/2009/08/03/starting-out-with-comet-orbited-part-3-%E2%80%93-the-client/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML5 will be next super star. So~~~How to using new idea to implement AJAX
My HTML5 application uses web workers to analyze an image's pixel data from a
Is html5 <time> tag well supported by browsers? (What browsers) Any Javascript function to
In the W3C working draft for HTML5 here's a line I find confusing: http://www.w3.org/TR/html5/introduction.html#html-vs-xhtml
The IETF recommends using base64 encoding for binary cookie values: https://datatracker.ietf.org/doc/html/draft-ietf-httpstate-cookie-07 So I use
I'm trying to build a AS3 socket server that can handshake with html5 websockets.
What are the key differences between HTML4 and HTML5 draft ? Please keep the
I'm working on a C# WebSocket server (currently supported by https://datatracker.ietf.org/doc/html/draft-ietf-hybi-thewebsocketprotocol-17 ). The server
The HTML5 draft specifies (at the moment at least), that the URI about:legacy-compat can
Can we integrate the FileAccess API of HTML with normal download of Files using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.