/    Sign up×
Community /Pin to ProfileBookmark

javascript and nested pages…

Hi Guys –

Have a bit of a nasty issue here, tricky thing I think. Hope you are able to help me!

I have developed a javascript which overlays the content of a web page. Nothing wrong so far, everything looks great when I look at the html page calling the script. All fine and dandy. However, when I look at the page through an iframe (or maybe even through another javascript call, not sure), the overlay does not appear on the page the iframe is called from, but within the iframe itself, obviously defeating its purpose of covering the content of a web page …

My question to you is: Is there any way I can specify the javascript to operate in the ‘parent’ window of the iframe, in order to get the overlay to work?

Thanks so much, keep up the great informative discussions, I’m learning by leaps and bounds ?

Mike

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Jan 13.2003 — Well if you write this line of code in the whichever page you have opened in the IFRAME

top.document.formName.element.vallue="local value form I-frame";

or you can swap it with any javaScript function or variable.

you should be able to see that in the parent window.

Was this you concern?

Khalid
Copy linkTweet thisAlerts:
@AS-MikeauthorJan 13.2003 — Khalid -

Unfortunately, that's not possible. I have no direct control over the page which has the iframe code inserted. The only factor I can control is the JS and the HTML file being called in the iframe ...

Any more takers? ?

Mike
Copy linkTweet thisAlerts:
@khalidali63Jan 13.2003 — Then you must know that what is on that page that is opened in the iframe?

don't you

Khalid
Copy linkTweet thisAlerts:
@AS-MikeauthorJan 13.2003 — I sure do Khalid. The page called in the iframe is an HTML page linking to a javascript creating the content overlay.

The problem is this way, the overlay is being applied within the iframe and not within the page the iframe is being called from, so the result disappears since the user won't see it ...

Does that clarify things a bit?

Mike
×

Success!

Help @AS-Mike 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...