473,378 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Access one iframe from another

2
Hello group...

I have a page that I'm building out that has a main area and I've used iframes in various different templates...so far so good...until now.

here's the javascript:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function loadIframe(iframeName, url) {
  3.   if ( window.frames[iframeName] ) {
  4.     window.frames[iframeName].location = url;   
  5.     return false;
  6.   }
  7.   else return true;
  8. }
  9. </script>
and the html:

Expand|Select|Wrap|Line Numbers
  1. <td background="images/photo_14.gif" width="751" height="433">
  2. <table width="751" height="433" border="0">
  3.       <tr>
  4.          <td width="285"><iframe name="leftifrm" id="leftifrm" src="revlist.html" allowtransparency="true" width="279" height="433" scrolling="auto" frameborder="0">Sorry, your browser doesn't support iframes.</iframe>
  5.         </td>
  6.         <td width="456"><iframe name="rightifrm" id="rightifrm" src="reviews/1.html" allowtransparency="true" width="462" height="433" scrolling="auto" frameborder="0">Sorry, your browser doesn't support iframes.</iframe>
  7.         </td>
  8.      </tr>
  9. </table>          
  10. </td>
the left frame holds a lists of links than when clicked populate the right frame...at least that's the goal but it's not happening. I understand why, I just don't know how to solve it.

Obviously since I name the iframes in this first document the revlist.html that resides in leftifrm has no way to reference where to load the content and so instead of loading in the right frame it does so in the left frame.

Here's one of the links that resides in revlist.html:
Expand|Select|Wrap|Line Numbers
  1. <a href="reviews/1.html" onclick="return loadIframe('rightifrm', this.href)">Theatre Preview</a>
Is there a solution to this? I've been looking through iframe documentation all over the web for hours and nada.

Thanks in advance for your help
Sep 17 '07 #1
3 2240
Logician
210 100+
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function loadIframe(iframeName, url) {
  3.   if ( window.frames[iframeName] ) {
  4.     window.frames[iframeName].location = url;   
  5.     return false;
  6.   }
  7.   else return true;
  8. }
  9. </script>
Thanks in advance for your help
If loadIframe is in one of the iframes, it should refer to parent.frames[...].

You're welcome in advance.
Sep 18 '07 #2
acoder
16,027 Expert Mod 8TB
Changed thread title to better describe the problem.
Sep 18 '07 #3
nero
2
If loadIframe is in one of the iframes, it should refer to parent.frames[...].

You're welcome in advance.
perfect!! :)

thank you
Sep 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Steve | last post by:
This really surprised me. I setup an iFrame in my document to display data from another table. For me, this was a way to be able to update that data without having to reload the whole page. Also,...
1
by: Cindy Lee | last post by:
I'm trying to dynamically set the height of my Iframe. my https: main page is calling another https in an Iframe. But i get an access denied error from my javascript trying to call the parent...
1
by: James Wallace | last post by:
I need to know how to change the src property of an iframe from script that is executed in another iframe with both of these iframes being contained on a document which is then contained by another...
3
by: karthickdevi | last post by:
Hi, I have an iframe , say 'iframe01' in my parent document. In the same parent document, i have a div tag and inside the div tag, i have another iframe, say 'iframe02'. Now i want to access...
7
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the...
4
by: Yansky | last post by:
Is it possible to read the DOM of an iframe if the iframe's src is from another domain? I realise I can't manipulate the DOM from another domain for security reasons, but can I access the DOM...
1
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the...
3
by: ysakaed | last post by:
Hi I am trying to get the content of the iframe to replace the content inside a div here is the code i use. function changeContent(content) { var buf = content + "_2"; var iframe =...
9
by: Lee | last post by:
Hi all, We need to create a page where we detect the finish of a game that's hosted on another site. We thought of doing it with frames, where we would put the game in an iframe that is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.