URL parameters are also called query string parameters. These carry so many important information, such as user preferences, search queries, link referrals, and many more. Use this tool to parse the parameters of a URL. Put the URL into the box and hit click to get parameters on the result section.
URL
Result will display here.
Here is the little script showing how it works. Thanks to the URLSearchParams, it has made the script a lot shorter.
Happy coding!
12345678function
getUrlParameters(url) {
var
searchParams;
url =
new
URL(url);
searchParams = url.searchParams;
searchParams.forEach(
function
(value, key) {
console.log(value, key);
});
};
No comments:
Post a Comment