O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pushing information to web clients

The IoT Gateway includes a mechanism to push information to connected web clients. Pages that accept information pushed to them, should include the Events.js JavaScript file in a JavaScript metadata reference. For example:

JavaScript: /Events.js

Each such page will include JavaScript that creates a TabID and registers itself with the server-side ClientEvents class, defined in Waher.IoTGateway. The ClientEvents class can then be used to check which tabs are registered with it, and for which resources. It can also be used to push data to the page. Methods available are:

Method

Description

GetOpenLocations()

Returns an array of locations (relative URLs) currently being viewed.

GetTabIDsForLocation() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required