@adan
You can use the URLSearchParams interface to get a variable from a URL in JavaScript. Here's an example:
1
|
const urlParams = new URLSearchParams(window.location.search); |
1
|
const variableValue = urlParams.get('variableName'); |
Replace 'variableName' with the name of the variable you want to retrieve from the URL. This code will parse the URL of the current page and extract the value of the specified variable.