Working on a home automation project that needs a set of toggle switches to first read initial on/off status from text file or mysql and then write back to the source when the button is toggled. I found some nice switches with documentation at https://github.com/rawnet/jquery-switch but I haven’t figured out how to implement the code. I have the external .js and .css files with the webpage but I don’t think I have linked to it properly. Here is what I have so far.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$('select').switchify();
$('select').data('switch').bind('slide', function(e, type) {
$('ul').append('<li>Switching ' + type);
});
});
});
</script>
</head>
<body>
<select>
<option value="1">On</option>
<option value="0">Off</option>
</select>
</body>
</html>
First I need to get the buttons to display and toggle. Then I need to establish the file link.