Answers for "how can get the javascript parameter in html url"

29

get parameter from the actual url javascript

// https://testsite.com/users?page=10&pagesize=25&order=asc
const urlParams = new URLSearchParams(window.location.search);
const pageSize = urlParams.get('pageSize');
Posted by: Guest on December-04-2020
0

get url params with js

const queryString = window.location.search;

const urlParams = new URLSearchParams(queryString);

const page_type = urlParams.get('page_type')

console.log(page_type);
Posted by: Guest on August-08-2021

Code answers related to "how can get the javascript parameter in html url"

Code answers related to "Javascript"

Browse Popular Code Answers by Language