login/register

Snip!t from collection of Alan Dix

see all channels for Alan Dix

Snip
summary

The EventSource enabler allows you to use the upcoming E...
The Event Source API allows you to generate JavaScript e ...
To use the EventSource enabler, simply include the enabl ...
<script type="text/javascript" src="http://eventsource.l ...
You're read

Home | EventSource | Ericsson Labs
https://labs.ericsson.com/apis/eventsource/

Categories

/Channels/techie/JavaScript

[ go to category ]

/Channels/techie/web development

[ go to category ]

For Snip

loading snip actions ...

For Page

loading url actions ...

The EventSource enabler allows you to use the upcoming Event Source API in any current web browser. Simply include the enabler library in your page, and you are able to use the API. When user agents implement the Event Source API themselves, your application will immediately and transparently start using the native implementation.

The Event Source API allows you to generate JavaScript events on your web server, and have them fired in a client web browser. It greatly simplifies the process of periodic updates from a remote web server, through a combination of HTTP polling and streaming.

To use the EventSource enabler, simply include the enabler javascript as follows:

<script type="text/javascript" src="http://eventsource.labs.ericsson.net/ESProxy/library/?key=YOUR_API_KEY"></script>

You're ready to go! Just use the Event Source API to receive your server's events. You can also take a look at our examples.

HTML

<p>The EventSource enabler allows you to use the upcoming <a class="ext" href="http://www.w3.org/TR/eventsource/">Event Source API</a><span class="ext"></span> in any current web browser. Simply include the enabler library in your page, and you are able to use the API. When user agents implement the Event Source API themselves, your application will immediately and transparently start using the native implementation.</p> <p>The Event Source API allows you to generate JavaScript events on your web server, and have them fired in a client web browser. It greatly simplifies the process of periodic updates from a remote web server, through a combination of HTTP polling and streaming.</p> <p>To use the EventSource enabler, simply include the enabler javascript as follows:</p> <p><span class="geshifilter"><code class="geshifilter-html4strict"><span style="color: rgb(0, 153, 0);">&lt;<span style="color: rgb(0, 0, 0); font-weight: bold;">script</span> <span style="color: rgb(0, 0, 102);">type</span><span style="color: rgb(102, 204, 102);">=</span><span style="color: rgb(255, 0, 0);">"text/javascript"</span> <span style="color: rgb(0, 0, 102);">src</span><span style="color: rgb(102, 204, 102);">=</span><span style="color: rgb(255, 0, 0);">"http://eventsource.labs.ericsson.net/ESProxy/library/?key=YOUR_API_KEY"</span>&gt;&lt;<span style="color: rgb(102, 204, 102);">/</span><span style="color: rgb(0, 0, 0); font-weight: bold;">script</span>&gt;</span></code></span></p> <p>You're ready to go! Just use the <a class="ext" href="http://www.w3.org/TR/eventsource/">Event Source API</a><span class="ext"></span> to receive your server's events. You can also take a look at our examples.</p>