(function () { var STRIP_PARAMS = ['_gl', '_ga', 'utm_referrer']; function cleanGAParams(a) { try { var url = new URL(a.href); var changed = false; STRIP_PARAMS.forEach(function (p) { if (url.searchParams.has(p)) { url.searchParams.delete(p); changed = true; } }); if (changed) a.setAttribute('href', url.toString()); } catch (e) {} } // Target any link going to giving.purdue.edu (covers all buttons sitewide) document.addEventListener('click', function (e) { var a = e.target.closest('a[href*="giving.purdue.edu"]'); if (a) cleanGAParams(a); }, true); document.addEventListener('contextmenu', function (e) { var a = e.target.closest('a[href*="giving.purdue.edu"]'); if (a) cleanGAParams(a); }, true); // Sweep on load + delayed for slider content function sweep() { document.querySelectorAll('a[href*="giving.purdue.edu"]').forEach(cleanGAParams); } document.addEventListener('DOMContentLoaded', sweep); window.addEventListener('load', sweep); setTimeout(sweep, 2000); })();
document.querySelectorAll('#three-links a').forEach(link => { link.addEventListener('click', function(event) { const cleanURL = link.href.split('?')[0]; link.setAttribute('href', cleanURL); // Update the href attribute window.open(cleanURL, '_blank'); event.preventDefault(); // Prevent default navigation }); link.addEventListener('contextmenu', function(event) { const cleanURL = link.href.split('?')[0]; link.setAttribute('href', cleanURL); // Update the href attribute for context menu }); });
1 2 3 4 … 9