/    Sign up×
Community /Pin to ProfileBookmark

help modifying links’ onclick values in iframe

How to change links onclick in embedded iframe?
Using javascript and the DOM I am trying to change all the links’ onclick values in an iframe. I would like to loop through each link and modify it. the processing would be done where the iframe is being printed not where the links are. The source of the iframe is external and not editable before it is printed. please provide code if you can help. what i have been playing with is

document.getElementById(‘id_of_frame’).getElementsByTagName(‘a’));

this is where i am stuck. thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorMar 25.2008 —  The source of the iframe is external and not editable before it is printed. [/QUOTE]
As far as I know it is not to be done, at least not with javascript, because the document loaded in your iframe does not belong to the same domain as the parent document.
×

Success!

Help @melon_pirate 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,
)...