Skip to content

Instantly share code, notes, and snippets.

@LelandSindt
Last active February 2, 2016 23:17
Show Gist options
  • Save LelandSindt/faa038e014e3a147332d to your computer and use it in GitHub Desktop.
Save LelandSindt/faa038e014e3a147332d to your computer and use it in GitHub Desktop.
<html> <head> <title> Color </title> <link rel="shortcut icon" href="data:image/vnd.microsoft.icon;base64,AA =="></link>
<script> var HttpRequestObject = false;
if (window.XMLHttpRequest) { HttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { HttpRequestObject = new ActiveXObject('Microsoft.XMLHTTP'); }
function changeColor() { if(HttpRequestObject) { HttpRequestObject.open('GET', 'http://nuru.local/setcolor?red=' + document.options.red.value + '&green=' + document.options.green.value +'&blue=' + document.options.blue.value, true); HttpRequestObject.send(); } }
</script> </head> <body>
<form name='options'>
Red <input type=range min=0 max=255 step=1 value=0 name='red' onchange='changeColor();'> <br>
Green <input type=range min=0 max=255 step=1 value=0 name='blue' onchange='changeColor();'> <br>
Blue <input type=range min=0 max=255 step=1 value=0 name='green' onchange='changeColor();'> <br>
</form>
</body> </html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment