I'm trying to get part of the URL and redirect to that part.
What I mean is that a Script generates a Link that gets opened. This link would be https://mywebsite.com/?s=https://google.com.
I now want to take the https://google.com part of the URL and redirect to that after a 5 second Timer.
How would I do that?
I tried
<script>
const parsedUrl = new URL(window.location.href);
console.log(parsedUrl.searchParams.get("s"));
</script>
Which logs the URL i need in the console but I don't know how to redirect to that URL now after a 5 second Timer
Thanks for your advice!