Click to See Complete Forum and Search --> : javascript and nested pages...


AS-Mike
01-12-2003, 07:35 PM
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

khalidali63
01-12-2003, 11:23 PM
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

AS-Mike
01-13-2003, 12:40 PM
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

khalidali63
01-13-2003, 12:52 PM
Then you must know that what is on that page that is opened in the iframe?
don't you

Khalid

AS-Mike
01-13-2003, 01:29 PM
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