Skip to content

Instantly share code, notes, and snippets.

@roquito
Created May 27, 2013 01:36
Show Gist options
  • Save roquito/5654751 to your computer and use it in GitHub Desktop.
Save roquito/5654751 to your computer and use it in GitHub Desktop.
Hi, I am trying to practice building a simple web page with a button that, when clicked, puts a value of 255 to one of my datastreams. Can anyone indicate/edit this code to point out what is wrong with it:
//<!DOCTYPE html>
//<html>
//<head>
<script>
xively.setKey( "MYKEY" );
function myFunction()
{
xively.datastream.update("13332118", "Toggle", '255', callback(data))
}
</script>
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://d23cj0cdvyoxg0.cloudfront.net/xivelyjs-1.0.3.min.js"></script>
<p>Click the button to trigger a function.</p>
<button onclick="myFunction()">TEST</button>
<p id="demo"></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment