By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Accessing iframe from within frame ???

P: n/a
I have this (sorry if you not using fixed spacing font;-)

|----------|---------------------|
| Frame_1 | Frame_2 |
| | |----------------| |
| | | IFrame_1 | |
| | |----------------| |
| | |
| | <a onClick=... |
|----------|---------------------|

I.e. my application has been embedded in a frameset at from a third
party.

I'm using an iframe - here "IFrame_1" that I'm reloading then a user
clicks an <a> link - code looks like this:

<a href='#' onClick="parent.Iframe_1.location='test.html';">.. .</a>

This works fine when my page is not embedded in a frameset. However,
when it is, I am getting a JavaScript run time error:

Error: parent.IFrame_1 is null or not an object
Anyone has a hint?
Thanks!
-nets

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
nets wrote:
<snip>
<a href='#' onClick="parent.Iframe_1.location='test.html';">
...</a>

This works fine when my page is not embedded in a frameset.
However, when it is, I am getting a JavaScript run time error:

Error: parent.IFrame_1 is null or not an object
Anyone has a hint?


Leave the javascript alone until you comprehend at least the basics of
HTML. Use:-

<a href="test.html" target="IFrame_1">...</a>

- and double up "IFrame_1" as both the name and ID of the IFRAME.

Richard.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.