Can someone help me write a JavaScript that, when used, would take any given URL in the browser’s URL field and append something to it after the “.com” and before anything else that follows.
Specifically, if I were on http://www.example.com/test, then I would want something to be added, say var.ia.bles to be appended in between the “.com” and “/test” such that it looks like this: http://www.example.com.var.ia.bles/test.
At the end of this task, it would be nice to be able to refresh the browser in such a way it now directs the end user to the path the modified URL points to.
The
locationobject has all the pieces you need.