Skip to content

Instantly share code, notes, and snippets.

@DeastinY
Created November 11, 2015 09:38
Show Gist options
  • Save DeastinY/b657dbb0a3b306618e68 to your computer and use it in GitHub Desktop.
Save DeastinY/b657dbb0a3b306618e68 to your computer and use it in GitHub Desktop.
//Add OnClickAJAX to Switches
$(".bootstrap-switch").on('switchChange,boostrapSwitch',function(event,state) {
alert("Toggled!");
$.ajax({
url: '/togglelamp',
data: 'TEST',
type: 'POST'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment