Skip to content

Instantly share code, notes, and snippets.

@john77eipe
Created August 24, 2016 09:10
Show Gist options
  • Save john77eipe/dc50b00ce59d15e4108ea2430dc1ecd9 to your computer and use it in GitHub Desktop.
Save john77eipe/dc50b00ce59d15e4108ea2430dc1ecd9 to your computer and use it in GitHub Desktop.
<body>
<h3>Climate Temperature Toolbox</h3>
<input type="button" value="start" id="start" />
<input type="button" value="stop" id="stop" />
Send Weather Data for your home city:
<br /><br />
City: <input type="text" id="home-city" />
Celsius: <input type="text" id="home-temperature" />
<input type="button" value="send" id="send" />
<br />
Weather Data from other cities:
<ul id="cities">
</ul>
<script>
//self executing function here
(function() {
// your page initialization code here
// the DOM will be available here
document.getElementById("start").addEventListener("click", startEventStream);
document.getElementById("send").addEventListener("click", sendHomeTemperature);
document.getElementById("stop").addEventListener("click", stopEventStream);
})();
function stopEventStream() {
console.log("stopEventStream()");
window.evntSrc.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment