Closed hugolpz closed 3 months ago
Use :
function getUrlParameter(name) { const urlParams = new URLSearchParams(window.location.search); return urlParams.get(name) || ''; } // Assuming the URL is "http://example.com/?search=test&lang=en" console.log(getUrlParameter('search')); // Output: "test" console.log(getUrlParameter('lang')); // Output: "en" console.log(getUrlParameter('page')); // Output: ""
✅ Done !
Use :