0

In a client side script (JavaScript, HTML etc.) how do I make the page redirect to a link specified in the address bar when a function had been called.

Example: Address bar says: Example.com/(code containing redirect link)

When a certain function is called, for example, it will redirect to a page specified in the "(code containing redirect link)"

Here is a question similar (it isn't client side, like what I need): how to get the value from address bar entered by client?

Thanks in advance.

Community
  • 1
  • 1
Guy Keogh
  • 549
  • 2
  • 5
  • 15
  • possible duplicate of [Use the get parameter of the url in javascript](http://stackoverflow.com/questions/827368/use-the-get-parameter-of-the-url-in-javascript) – Barmar Jul 01 '13 at 21:51

1 Answers1

0

I am not sure why you would want to do that but here goes:

//Sets location for current window       
window.location = window.location.pathname; // Get the string after the /
raam86
  • 6,785
  • 2
  • 31
  • 46