-
-
Save simonj/43f73b45b5c4f20cfcbb to your computer and use it in GitHub Desktop.
test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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