Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / December 2004



Tip: Looking for answers? Try searching our database.

Accessing iframe from within frame ???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nets - 31 Dec 2004 00:49 GMT
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
Richard Cornford - 31 Dec 2004 01:57 GMT
<snip>
> <a href='#' onClick="parent.Iframe_1.location='test.html';">
>...</a>
[quoted text clipped - 4 lines]
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.