
Quick Javascript Jquery Fix - Prepend URL's and encode original href
- or -
Post a project like this4715
£6(approx. $8)
- Posted:
- Proposals: 3
- Remote
- #287345
- Completed
Description
Experience Level: Entry
This should be a quick fix for any one that knows exactly what to do.
Trying to change all hrefs on a page and prepend them with a string followed by encoding the original url.
See code below and also attached in html file.
link
var orig_href = $(this).attr("href");
$("a").attr("href", "http://mydatahere=" + "encodeURI(orig_href)");
Trying to change all hrefs on a page and prepend them with a string followed by encoding the original url.
See code below and also attached in html file.
link
var orig_href = $(this).attr("href");
$("a").attr("href", "http://mydatahere=" + "encodeURI(orig_href)");
Purple9
100% (190)Projects Completed
191
Freelancers worked with
136
Projects awarded
21%
Last project
11 Feb 2026
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies