Simple javascript get paramater url

const pU = window.location.search; const pS = new URLSearchParams(pU); const gP = (k) => { if(pS.has(k)) { const v = pS.get(k); sessionStorage.setItem(k, v); } }; gP('your_param');
Simple javascript get paramater url and set item into sessionStorage

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.