for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
var deptData = null;
function getDepartmentDone(jqXHR)
{
if(jqXHR.status !== 200 || jqXHR.responseJSON === undefined)
alert('Unable to obtain department!');
return;
}
var data = jqXHR.responseJSON;
deptData = data;
$('#departmentNameRO').append(data.departmentName);
$('#departmentName').val(data.departmentName);
if(data.description !== undefined)
$('#description').val(data.description);
if(data.public)
$('#public').prop('checked', true);
$('#privateDept').hide();
console.log(data);
console.log
function publicChanged()
if($('#public').prop('checked'))
else
$('#privateDept').show();
function viewShifts()
window.location = 'shifts.php?id='+deptData.departmentID;
return false;
function initPage()
var id = getParameterByName('id');
if(id === null)
$.ajax({
url: 'api/v1/departments?$top=1',
type: 'GET',
dataType: 'json',
complete: getDepartmentDone});
url: 'api/v1/departments/'+id,
$(initPage);