Nurseries and Schools


Advertisement
Advertisement


Advertisement

100,000+

Happy Parents/Carers

1.5 M+

Website Visits

50,000+

Listings Registered

96%

Find the website useful

Latest Reviews

Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
${item.desc}
${item.badge || ""}
`).appendTo(ul); }; $("#searchForm").on("submit", function (e) { const term = $("#home-search").val().trim(); e.preventDefault(); if (selectedItem && selectedItem.slug) { return false; } fetch(`https://www.nurseriesandschools.org/search-term-type?term=${encodeURIComponent(term)}`) .then(res => res.json()) .then(data => { const slug = term.replace(/\s+/g, ''); let url = ''; if (data.type === 'postcode') { url = `https://www.nurseriesandschools.org/search_result/searchpostcode/${slug}`; } else if (data.type === 'location') { url = `https://www.nurseriesandschools.org/search_result/searchlocation/${slug}`; } else { showNotification("No data found. Please search properly.", 'error', 7500, 'top'); return; } $('#SearchButtonOne').prop('disabled', true).text('Please wait...'); $('#loadingSpinner, #loadingOverlay').show(); setTimeout(() => window.location.href = url, 300); }) .catch(() => this.submit()); // normal submit if API fails }); }); getLocation(); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, showError); } else { showNotification("Geolocation is not supported by this browser.", 'error', 7500, 'top'); } } function showPosition(position) { jQuery.ajax({ url: "https://www.nurseriesandschools.org/get-visitor-location?lat=" + position.coords.latitude + '&lng=' + position.coords.longitude, method: "GET", success: function(data) { jQuery('#pincode').val(data.name + ' (' + data.pincode + ')'); jQuery('#pincode').attr('data-pincode', data.pincode); } }); } function showError(error) { switch (error.code) { case error.PERMISSION_DENIED: //showNotification("User denied the request for Geolocation.", 'error', 7500, 'top'); break; case error.POSITION_UNAVAILABLE: showNotification("Location information is unavailable.", 'error', 7500, 'top'); break; case error.TIMEOUT: showNotification("The request to get user location timed out.", 'error', 7500, 'top'); break; case error.UNKNOWN_ERROR: showNotification("An unknown error occurred.", 'error', 7500, 'top'); break; } } document.addEventListener("DOMContentLoaded", function () { const rotateAllBanners = (containerIds, interval = 100) => { containerIds.forEach(containerId => { const container = document.getElementById(containerId); if (!container) return; const images = container.getElementsByClassName('banner-img'); if (images.length === 0) return; let current = 0; setInterval(() => { images[current].style.display = 'none'; current = (current + 1) % images.length; images[current].style.display = 'block'; }, interval); }); }; // List of all banner container IDs const bannerContainers = [ 'position_one_banner', 'position_two_banner', 'position_three_banner', 'position_four_banner', 'position_five_banner', 'position_six_banner', 'position_seven_banner', 'position_eight_banner', 'position_nine_banner', ]; rotateAllBanners(bannerContainers, 10000); });