Generation

generate functionWed, 14 Dec 2022

get the url parameter of the current page

function getUrlParams(name) { var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); var r = window.location.search.substr(1).match(reg); if (r !== null) { return decodeURIComponent(r[2]); } return null; }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant