Similar Question:
How to retrieve query variables using JQuery?
Retrieve query string values in JavaScript
If my website's URL is
(where both parameters are URLs)
What I want to achieve now is extracting two javascript variables from the site, each containing the values of the respective URLs. For instance, the first variable would hold testsite.com, and the second one would have sample.com [including http and all, but only one hyperlink can be displayed]
How can this be accomplished?
I came across similar inquiries on this platform where users proposed complex solutions involving finding '=' and extracting everything after it, which left me puzzled. In this case, such a method would result in "http:// www.testsite.com&r= [excluding spaces]" as one of the variables.
Another user had multiple parameters like mine, but their solution was too convoluted for me to comprehend how to customize it for my needs.
Therefore, could someone provide guidance on how to solve this issue?