Skip to content

Instantly share code, notes, and snippets.

@simonj
Created July 20, 2015 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonj/43f73b45b5c4f20cfcbb to your computer and use it in GitHub Desktop.
Save simonj/43f73b45b5c4f20cfcbb to your computer and use it in GitHub Desktop.
test
function updateCenterStats(cid)
{
console.log('clicked');
//var checkbox = $("input[type='checkbox']").val();
var checkbox = $("input[type='checkbox']").prop('checked');
console.log('checkbox: '+ checkbox);
var center = null;
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
'async' : false,
'global' : false,
'type' : 'GET',
'url' : "./center/updateActiveState",
'dataType' : "json",
'data': {
cid: cid,
activeState: checkbox
},
beforeSend: function() {
},
success: function(data) {
console.log("Success!");
console.log(data);
},
error: function(xhr, textStatus, thrownError) {
console.log(xhr);
console.log(textStatus);
console.log(thrownError);
console.log('Something went to wrong.Please Try again later...');
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment