/    Sign up×
Community /Pin to ProfileBookmark

Replace / change links within iframes

Hi,

I’ve got an iframe on my page that displays my affiliate’s webpages (located on their domain).

Two concerns:

First, all links within the iframe reveal their domain name in the status bar and in the page source, i.e. <a href=”affiliate.com/buy.htm”>.

Second, the links in the iframe have target=”_blank” which opens new tabs/windows, also exposing their domain to my customers.

Would it be possible to replace all instances of “affiliate.com” inside the iframe to “mysite.com”; whereas, “mysite.com” will be a proxy forwarding requests to “affiliate.com”? Keep in mind that these elements do not have ID or Class.

Any advice is welcomed!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Jul 03.2010 — Yes, but you need a server-side script. Look at PHP, ASP, Java, anything that is supported on your server.
×

Success!

Help @exius spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...