document.addEventListener("DOMContentLoaded", () => { // Target your link element inside the collection list const pdfLinks = document.querySelectorAll('.community-report-wrapper'); pdfLinks.forEach(link => { link.addEventListener('click', async (e) => { // Prevents the browser from just opening the ugly URL in a new tab e.preventDefault(); const fileUrl = link.href; if (!fileUrl) return; try { // Fetch the file data const response = await fetch(fileUrl); const blob = await response.blob(); // Extract the filename from the end of the URL and decode the %20 spaces const rawFileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1); // Strips out the Webflow unique ID prefix if it exists (e.g., 6a3b0d3800dff42713575a1a_) const cleanFileName = decodeURIComponent(rawFileName).replace(/^[a-f0-9]{24}_/, ''); // Create a temporary hidden link to trigger the forced download const downloadLink = document.createElement('a'); downloadLink.href = window.URL.createObjectURL(blob); downloadLink.download = cleanFileName; document.body.appendChild(downloadLink); downloadLink.click(); // Cleanup memory document.body.removeChild(downloadLink); window.URL.revokeObjectURL(downloadLink.href); } catch (error) { console.error("Download failed, falling back to default link behavior:", error); // Fallback: if fetch fails (e.g., CORS issues), open the link normally window.open(fileUrl, '_blank'); } }); }); });

May Pen

May Pen

Established between 1660 and 1683, the town of May Pen is characterised by its busy Main Street and Sevens Road, home to a vibrant open-air market, transportation centre, banks, hardware stores, pharmacies and eateries. The nearby Denbigh Agricultural Show Ground promotes agriculture, textiles and livestock production, hosting the largest agricultural event in the English-speaking Caribbean during Jamaica's Independence Celebration (August 6).

Views from the community

COMMUNITY transformation action plan (ctap)

Download the latest
Quarterly Report

Download our report

GET INVOLVED IN THE TRANSFORMATION!

fahwud logo