Returns the value of the specified query parameter in the input URL.
Usage:
const p1 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't3');const p2 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't4');console.log(p1, p2); Copy
const p1 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't3');const p2 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't4');console.log(p1, p2);
Output:
3 4 Copy
3 4
The URL string.
The query parameter to retrieve the value for.
The value of the specified query parameter, or an empty string if the parameter is not found.
Returns the value of the specified query parameter in the input URL.
Usage:
Output: