Start digging into the API from the LightstreamerClient object.
When running in a browser window some limitation may apply:
- On the non-webkit versions of Opera and on older versions of other browsers (IE<=7, FX<=3) both Ligthtstreamer server and the Web Server which supplies the front-end pages
must share a common domain for the streaming to work; so, as an example, if the web server is www.mycompany.com and the Lightstreamer server is push.mycompany.com the following code is needed:
document.domain="mycompany.com";
Note that, as a consequence, you may need to set the document.domain in other front-end pages too, in order to allow them to interoperate with pages that have their document.domain set.
Further details and special cases can be found in the "Additional notes" section of the "Lightstreamer JS Client - Deployment Config Matrix" document. - On the non-webkit versions of Opera and on older versions of other browsers (IE<=7, FX<=2)
if an HTML "A" element is used to run javascript code, then the
href="javascript:myStuff()"
syntax should not be used, as it may cause the streaming connection to be stopped. Thehref="#" onClick="myStuff(); return false;"
syntax should be used, instead.
Note the final "return false;" statement, which prevents the execution of the default event handler. If missing, the browser may change the displayed address by adding "/#"; some browsers (e.g. Firefox) may even add a spurious entry in the history list.
Anyway remember that you can also associate onclick events to elements other than "A" avoiding the problem altogether. - Some browsers are permitted to open a limited number of concurrent HTTP connections per server.
If the front-end is composed by different html pages (or one single html page using different
LightstreamerClient
instances), each one with the need to get data from the same Lightstreamer server, you may want them to share the same connection to avoid saturating the connection pool. You can leverage theconnectionSharing
property of yourLightstreamerClient
instance to make variousLightstreamerClient
share the connection. - On IE6 if a page contains a
LightstreamerClient
instance, then it cannot be used as a link target or referred to in a "window.open" command, because, even in case the link is meant to preserve the page (i.e. to access it without replacing it, as in "myPage.html#position") this may stop the streaming connection. - Other common issues can find a solution on our public forum.
The library can also be used inside a Web Worker (excluding non-webkit Opera versions). The library generator highlights which class can or can't be used on such environment.
The sources of some of the classes of this library are available on GitHub. See details here
Check out the available examples and associated README to learn more.
The JavaScript library can be available depending on Edition and License Type. To know what features are enabled by your license, please see the License tab of the Monitoring Dashboard (by default, available at /dashboard).
Note the following documentation convention:
Function arguments qualified as <optional> can be omitted only if not followed by further arguments. In some cases, arguments that can be omitted (subject to the same restriction) may not be qualified as <optional>, but their optionality will be clear from the description.