GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Nov-2008, 09:25
bobsam bobsam is offline
New Member
 
Join Date: May 2008
Posts: 7
bobsam is on a distinguished road
Question

Iframes and frames


I have a problem with frames, I have two frames, and within one of them are two iframes, if something is pressed in one of the iframes, I want the other one to refresh.
But every thing I have tried with my limited knowledge of javascript seems to not work.
Is there some way to do it using meta tags?

Could anyone please give me any code which might work please.

Anything is appreciated.

Bobsam
  #2  
Old 29-Mar-2009, 16:17
4folds 4folds is offline
New Member
 
Join Date: Mar 2009
Posts: 2
4folds is on a distinguished road

Re: Iframes and frames


I'm not sure if this'll help, but it sounds like all you need to do is have things open in a "parent window". When something is "pressed", I assume you mean they click on a link and then you want everything to refresh. If you target the links to "parent window" it'll refresh the whole page (i.e. both frames) to whatever they click on. Typically all that entails is putting: target="_parent" in the link lines. I'm not sure if this answers your question, but I figured it couldn't hurt to tell you what came to mind...
  #3  
Old 30-Mar-2009, 01:50
MisterChucker's Avatar
MisterChucker MisterChucker is offline
Junior Member
 
Join Date: Mar 2009
Location: Cyberspace, Earth
Posts: 53
MisterChucker is a jewel in the roughMisterChucker is a jewel in the roughMisterChucker is a jewel in the rough

Re: Iframes and frames


The refresh problem was giving me a headache. Firefox seems to do whatever it wants with the cache, so using the history to do a refresh wasn't working. Then I remembered I solved this one before, so I dug into some old code and found the answer.

In Internet Explorer, there are two ways you can refresh a page (or frame) using Javascript. One way is to go to the current page in the history.
Code:
history.go(0)
The other way, which is what you should use because it is the way that also works with Firefox, is to navigate to the current page.
Code:
window.location.href = 'current_page.html'

Now for the other part of the question, when working with frames make sure you give names to your frames.
HTML Code:
<iframe name="namedFrameA"></iframe> <iframe name="namedFrameB"></iframe>

You can reference another frame that shares the same parent by first referencing the parent by "parent", then the sibling frame by its name. From namedFrameA, you can call a function bMyValentine() that exists in namedFrameB.
Code:
parent.namedFrameB.bMyValentine()

For a more detailed demonstration, visit misterchucker.com/frames_in_frames or download the attachment.
Attached Files
File Type: zip frames_in_frames.zip (1.9 KB, 0 views)
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with using frames or iframes looneytherat Web Design Forum 18 16-Nov-2003 08:42

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:49.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.