How do get query string values in javascript

Spread the love

In Javascript, It has inbuilt URLSearchParams function  to get the query string values.

Example:
const query= new URLSearchParams(window.location.search);
const clientCode = query.get(“clientCode”);

 

Ref : https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams

admin

admin

Leave a Reply

Your email address will not be published. Required fields are marked *