Log out
Current signal
Signals
Menu
...
+
Clone signal
My Signals
Menu
Current panel
Panels
Menu
...
+
My Panels
Menu
Scheme
Timeline
Map
<
>
Arduino
+ESP01
NodeMCU
ESP32
Linux
Raspbian
Java
Python
Web
Javascript
Javascript libraries for Circus.
Name CircusJSLib2.0.0.js
Description Implements ReadValue and WriteValue in Javascript.
Download CircusJSLib2.0.0.js
Hardware Web Page
Examples.

In the example example_js_randomsignal there is displayed a single value from the signal Random Signal ignoring any location data (style='display:none')

In the example example_js_madridtemp there is displayed a temperature from the signal Temperature in Madrid reading location data (style='display:block')

How to
Steps:

Note! Only public signals can be embeded in a web (no token is needed).

1) Invoke the downloaded circuslib.js script (right before closing BODY tag). Do the same with jquery lib:

<script type="text/javascript" src="/your/realtive/path/circuslib.js"></script>
<script type="text/javascript" src="/your/realtive/path/jquery-3.1.0.js"></script>

2) Place this DIV in your HTML code, one for each signal to show, pasting key where asked, like this:

                <div class='circus' id='your_key_here'>
                    <div class='value'>
                        <!--VALUE will be placed here-->
                    </div>
                    <div class='location' style='display:none'>
                        <div class='loclabel'>Latitude: </div><div class='lat locelement'><!--LAT will be placed here--></div>
                        <div class='loclabel'>Longitude: </div><div class='lon locelement'><!--LON will be placed here--></div>
                        <div class='loclabel'>Altitude: </div><div class='alt locelement'><!--ALT will be placed here--></div>
                        <div class='loclabel'>Is moving: </div><div class='ismobile locelement'><!--ISMOBILE will be placed here--></div>
                    </div>
                </div>
                            

Note: if location is set to style='display:none' this div won't show and no queries about location will be done in order to free browser's load. Turn it to style='display:block' to work

3) Invoke function pollCircus() once. For instance, when your page loads, in the BODY tag:

<body onload="pollCircus()"> <!--will read every 2 seconds-->

optional) Give it some style, include this css file in your header

<link href="/your/relative/path/example_js.css" rel="stylesheet">

Of course, it's just an idea... feel free to change it

Circus Experiments with Javascript.
We have no experiments to show of this type yet