I am trying to make a javascript that goes makes <a>
go to another link, rather than the one specified in its href. E.g. I want
<a href="http://www.example.com/some-page">
To go to instead:
http://www.newexamplesite.com/http:%252F%252Fwww.example.com%252Fsome-page
Unfortunately I don't have access to jQuery for this application. Has to be pure javascript.
I'm looking for some javascript that can be included within the actual <a>
tag:
<a onclick="" href="http://www.example.com/some-page">
Note that the original link has to be detected and all
/
is needed to be replaced with%252F