Careers
`); } } else if(filter != “View By Location” && filterDept && filterDept != ‘View By Department’) { //console.log(‘here 2’) job[‘departments’].forEach(department => { if(selectedLocation === undefined) { if(filterDept && department[‘name’].trim() === filterDept.trim()) { jobs_content.push(`
${job[‘title’]}
${job[‘offices’][0][‘name’]}
`); } } else if(selectedLocation === “View By Location”) { //console.log(‘new check’) if(filterDept && department[‘name’].trim() === filterDept.trim()) { jobs_content.push(`
${job[‘title’]}
${job[‘offices’][0][‘name’]}
`); } } else if(selectedLocation.trim() === job[‘offices’][0][‘name’].trim() && filterDept && department[‘name’].trim() === filterDept.trim()) { //console.log(‘check 3’, selectedLocation) jobs_content.push(`
${job[‘title’]}
${job[‘offices’][0][‘name’]}
`); } }); } else if (selectedLocation != null && filterDept === “View By Department”) { //console.log(‘here 3’) if(selectedLocation.trim() === job[‘offices’][0][‘name’].trim()) { jobs_content.push(`
${job[‘title’]}
${job[‘offices’][0][‘name’]}
`); } } else { //console.log(‘here 4’) jobs_content.push(`
${job[‘title’]}
${job[‘offices’][0][‘name’]}
`); } job[‘departments’].forEach(department => { if(!job_departments.includes(department[‘name’].trim())) { job_departments.push(department[‘name’].trim()) } }); }); if (filterLocation.options.length { let option = document.createElement(“option”); option.text = location; option.value = location; if(filter == location || preselect && location == preselect) { option.selected = true; } filterLocation.appendChild(option); }); } let filterDepartment = document.getElementById(‘filterDepartment’); while (filterDepartment.options.length) filterDepartment.remove(0); option = document.createElement(“option”); option.text = “View By Department”; option.value = “View By Department”; filterDepartment.appendChild(option); job_departments.forEach(department => { let option = document.createElement(“option”); option.text = department; option.value = department; if(filterDept == department) { option.selected = true; } filterDepartment.appendChild(option); }); // jobs_content = shuffleArray(jobs_content); if(jobs_content.length Sorry, there are currently no open positions matching your search criteria, but check back soon!’; } else { if(!filter) { document.getElementById(‘jobs_listings’).innerHTML = ‘
‘ + jobs_content.slice(0, 12).join(”) + ‘
‘; } else { document.getElementById(‘jobs_listings’).innerHTML = ‘
‘ + jobs_content.join(”) + ‘
‘; } } } document.getElementById(‘filterLocation’).addEventListener(‘change’, function() { if (window.history.replaceState) { selectedLocation = filterLocation.value let url = ‘https://www.knowbe4.com/careers?filter=’+this.value; //prevents browser from storing history with each change: window.history.pushState({}, “[HR] Careers Home”, url); getJobs(jobs); } }); document.getElementById(‘filterDepartment’).addEventListener(‘change’, function() { //console.log(filterLocation.value) if (window.history.replaceState) { selectedDept = filterDepartment.value let url = ‘https://www.knowbe4.com/careers?department=’+this.value; //prevents browser from storing history with each change: window.history.pushState({}, “[HR] Careers Home”, url); getJobs(jobs); } });
Source