$(document).ready(function() { // AJAX Job Search on Homepage/Job List $('#jobSearchInput').on('keyup', function() { let query = $(this).val(); if (query.length >= 2) { $.ajax({ url: 'includes/ajax-search.php', method: 'POST', data: { query: query }, success: function(data) { $('#jobSearchResults').html(data); } }); } }); // Toast Notifications Helper window.showToast = function(message, type = 'success') { const toastId = 'toast-' + Date.now(); const toastHTML = ` `; if (!$('#toastContainer').length) { $('body').append('
'); } $('#toastContainer').append(toastHTML); const toastElement = new bootstrap.Toast(document.getElementById(toastId)); toastElement.show(); // Remove from DOM after hidden document.getElementById(toastId).addEventListener('hidden.bs.toast', function() { $(this).remove(); }); }; });